Re: spgist rangetypes compiler warning (gcc 7.2.0)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: spgist rangetypes compiler warning (gcc 7.2.0)
Дата
Msg-id 25711.1511041213@sss.pgh.pa.us
обсуждение исходный текст
Ответ на spgist rangetypes compiler warning (gcc 7.2.0)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: spgist rangetypes compiler warning (gcc 7.2.0)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> while compiling on gcc 7.2.0 (on ARM), I got this warning:

>     rangetypes_spgist.c: In function 'spg_range_quad_inner_consistent':
>     rangetypes_spgist.c:559:29: warning: comparison between pointer and
>     zero character constant [-Wpointer-compare]
>           if (in->traversalValue != (Datum) 0)
>                                  ^~

Huh.  I wonder why 7.2.1 on Fedora isn't producing that warning.

> I believe we should simply treat the traversalValue as pointer, and
> change the condition to
>     if (in->traversalValue)

Agreed, especially since it's done like that in spgscan.c and
geo_spgist.c.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Repetitive code in RI triggers
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: [HACKERS] VACUUM and ANALYZE disagreeing on what reltuples means