I wrote:
> Whether the code is actually safe or not, these [warnings] are not acceptable.
On looking closer, it seems the intent is to pass an argument of
unspecified type through parse_tsquery to a PushFunction:
typedef void (*PushFunction)(void *opaque, TSQueryParserState state, char *, int, int2);
extern TSQuery parse_tsquery(char *buf, PushFunction pushval, void *opaque, bool isplain);
That's fine, but not in a way that throws compiler warnings. There is a
standard solution for this task within PG: the arguments should be
declared as Datum not void*. Use the DatumGetFoo/FooGetDatum macros to
coerce back and forth.
Also, the declaration of typedef PushFunction really ought to provide
names for all the arguments, for documentation purposes. (Dare I
suggest a comment block specifying the API?)
regards, tom lane