[PATCH] Compiler warning cleanup
Attached patch fixes following sun studio compiler warning:
"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
Thanks Zdenek
Attachments:
warn.patchtext/x-patch; CHARSET=US-ASCII; name=warn.patchDownload
diff -Nrc pgsql.orig.5d4d60e3a557/src/backend/utils/adt/tsquery_op.c pgsql.orig/src/backend/utils/adt/tsquery_op.c
*** pgsql.orig.5d4d60e3a557/src/backend/utils/adt/tsquery_op.c 2009-05-22 17:00:22.081796110 -0400
--- pgsql.orig/src/backend/utils/adt/tsquery_op.c 2009-05-22 17:00:22.086155307 -0400
***************
*** 190,201 ****
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);
TSQuerySign
makeTSQuerySign(TSQuery a)
--- 190,201 ----
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)
TSQuerySign
makeTSQuerySign(TSQuery a)
diff -Nrc pgsql.orig.5d4d60e3a557/src/backend/utils/adt/tsvector_op.c pgsql.orig/src/backend/utils/adt/tsvector_op.c
*** pgsql.orig.5d4d60e3a557/src/backend/utils/adt/tsvector_op.c 2009-05-22 17:00:22.083116270 -0400
--- pgsql.orig/src/backend/utils/adt/tsvector_op.c 2009-05-22 17:00:22.086348815 -0400
***************
*** 174,186 ****
PG_RETURN_##ret( res action 0 ); \
}
! TSVECTORCMPFUNC(lt, <, BOOL);
! TSVECTORCMPFUNC(le, <=, BOOL);
! TSVECTORCMPFUNC(eq, ==, BOOL);
! TSVECTORCMPFUNC(ge, >=, BOOL);
! TSVECTORCMPFUNC(gt, >, BOOL);
! TSVECTORCMPFUNC(ne, !=, BOOL);
! TSVECTORCMPFUNC(cmp, +, INT32);
Datum
tsvector_strip(PG_FUNCTION_ARGS)
--- 174,186 ----
PG_RETURN_##ret( res action 0 ); \
}
! TSVECTORCMPFUNC(lt, <, BOOL)
! TSVECTORCMPFUNC(le, <=, BOOL)
! TSVECTORCMPFUNC(eq, ==, BOOL)
! TSVECTORCMPFUNC(ge, >=, BOOL)
! TSVECTORCMPFUNC(gt, >, BOOL)
! TSVECTORCMPFUNC(ne, !=, BOOL)
! TSVECTORCMPFUNC(cmp, +, INT32)
Datum
tsvector_strip(PG_FUNCTION_ARGS)
On Saturday 23 May 2009 00:04:26 Zdenek Kotala wrote:
Attached patch fixes following sun studio compiler warning:
"tsquery_op.c", line 193: warning: syntax error: empty declaration
[snip]
--- 190,201 ---- 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)TSQuerySign
makeTSQuerySign(TSQuery a)
I think this is not the best way to do it, because it will confuse pgindent
and editors and such. The DATA() macros in include/catalog have this solved;
see include/catalog/genbki.sh.
Peter Eisentraut píše v ne 24. 05. 2009 v 00:40 +0300:
I think this is not the best way to do it, because it will confuse pgindent
and editors and such. The DATA() macros in include/catalog have this solved;
see include/catalog/genbki.sh.
Attached variant with faked extern without ; which is what genbki.sh
uses.
Zdenek
Attachments:
warn_02.patchtext/x-patch; CHARSET=US-ASCII; name=warn_02.patchDownload
diff -Nrc pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsquery_op.c pgsql.orig/src/backend/utils/adt/tsquery_op.c
*** pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsquery_op.c 2009-05-25 16:45:34.594747865 +0200
--- pgsql.orig/src/backend/utils/adt/tsquery_op.c 2009-05-25 16:45:34.599072981 +0200
***************
*** 188,194 ****
PG_FREE_IF_COPY(b,1); \
\
PG_RETURN_BOOL( CONDITION ); \
! }
CMPFUNC(tsquery_lt, res < 0);
CMPFUNC(tsquery_le, res <= 0);
--- 188,196 ----
PG_FREE_IF_COPY(b,1); \
\
PG_RETURN_BOOL( CONDITION ); \
! } \
! /* keep compiler quiet - no extra ; */ \
! extern int no_such_variable
CMPFUNC(tsquery_lt, res < 0);
CMPFUNC(tsquery_le, res <= 0);
diff -Nrc pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsvector_op.c pgsql.orig/src/backend/utils/adt/tsvector_op.c
*** pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsvector_op.c 2009-05-25 16:45:34.596082053 +0200
--- pgsql.orig/src/backend/utils/adt/tsvector_op.c 2009-05-25 16:45:34.599263998 +0200
***************
*** 172,178 ****
PG_FREE_IF_COPY(a,0); \
PG_FREE_IF_COPY(b,1); \
PG_RETURN_##ret( res action 0 ); \
! }
TSVECTORCMPFUNC(lt, <, BOOL);
TSVECTORCMPFUNC(le, <=, BOOL);
--- 172,180 ----
PG_FREE_IF_COPY(a,0); \
PG_FREE_IF_COPY(b,1); \
PG_RETURN_##ret( res action 0 ); \
! } \
! /* keep compiler quiet - no extra ; */ \
! extern int no_such_variable
TSVECTORCMPFUNC(lt, <, BOOL);
TSVECTORCMPFUNC(le, <=, BOOL);
On Monday 25 May 2009 17:52:07 Zdenek Kotala wrote:
Peter Eisentraut píše v ne 24. 05. 2009 v 00:40 +0300:
I think this is not the best way to do it, because it will confuse
pgindent and editors and such. The DATA() macros in include/catalog have
this solved; see include/catalog/genbki.sh.Attached variant with faked extern without ; which is what genbki.sh
uses.
Done.