Sun Studio compiler warnings

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Sun Studio compiler warnings
Дата
Msg-id 4909C387.1090808@gmx.net
обсуждение исходный текст
Ответы Re: Sun Studio compiler warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Sun Studio compiler warnings  ("Robert Haas" <robertmhaas@gmail.com>)
Список pgsql-hackers
Sun Studio is producing these compiler warnings (among others):

"tsquery_op.c", line 193: warning: syntax error:  empty declaration 
"tsquery_op.c", line 194: warning: syntax error:  empty declaration 
"tsquery_op.c", line 195: warning: syntax error:  empty declaration 
"tsquery_op.c", line 196: warning: syntax error:  empty declaration 
"tsquery_op.c", line 197: warning: syntax error:  empty declaration 
"tsquery_op.c", line 198: warning: syntax error:  empty declaration

"tsvector_op.c", line 177: warning: syntax error:  empty declaration 
"tsvector_op.c", line 178: warning: syntax error:  empty declaration 
"tsvector_op.c", line 179: warning: syntax error:  empty declaration 
"tsvector_op.c", line 180: warning: syntax error:  empty declaration 
"tsvector_op.c", line 181: warning: syntax error:  empty declaration 
"tsvector_op.c", line 182: warning: syntax error:  empty declaration 
"tsvector_op.c", line 183: warning: syntax error:  empty declaration

This relates to the following sort of code:

#define CMPFUNC( NAME, CONDITION )              \
Datum                                           \
NAME(PG_FUNCTION_ARGS) {                        \    TSQuery  a = PG_GETARG_TSQUERY_COPY(0);     \    TSQuery  b =
PG_GETARG_TSQUERY_COPY(1);    \    int res = CompareTSQ(a,b);                  \
       \    PG_FREE_IF_COPY(a,0);                       \    PG_FREE_IF_COPY(b,1);                       \
                                 \    PG_RETURN_BOOL( CONDITION );                \
 
}

CMPFUNC(tsquery_lt, res < 0);
CMPFUNC(tsquery_le, res <= 0);
CMPFUNC(tsquery_eq, res == 0);
CMPFUNC(tsquery_ge, res >= 0);
CMPFUNC(tsquery_gt, res > 0);
CMPFUNC(tsquery_ne, res != 0);

The closing semicolon is strictly speaking not allowed here.  We could 
remove it, but that would probably upset pgindent?

I recall that we used to have a bunch of similar problems with the AIX 
compilers a long time ago.  Does anyone recall the solution, and do we 
still care?  (Note that it's only a warning in this case.)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Block-level CRC checks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Sun Studio compiler warnings