Re: apparent tsearch breakage on 64-bit machines

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: apparent tsearch breakage on 64-bit machines
Дата
Msg-id 4972.1189222472@sss.pgh.pa.us
обсуждение исходный текст
Ответ на apparent tsearch breakage on 64-bit machines  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: apparent tsearch breakage on 64-bit machines
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: integrated tsearch doesn't work with non utf8 database