Sun Studio compiler warnings

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Sun Studio compiler warnings
Date: 2008-10-30 14:24:07
Message-ID: 4909C387.1090808@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-30 14:32:22 Re: Sun Studio compiler warnings
Previous Message Gregory Stark 2008-10-30 14:11:22 Re: Block-level CRC checks