Re: 2x compile warning

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 2x compile warning
Дата
Msg-id 6727.1145914770@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 2x compile warning  (Kris Jurka <books@ejurka.com>)
Ответы Re: 2x compile warning  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Kris Jurka <books@ejurka.com> writes:
> On Mon, 24 Apr 2006, Martijn van Oosterhout wrote:
>> Perhaps someone could check if changing the test explicitly check
>> against NULL:
>> 
>> ((attnum) > (int) (tup)->t_data->t_natts) ? \
>> ( \
>> (((isnull) != NULL)? (*(isnull) = true) : (dummyret)NULL), \
>> (Datum)NULL \
>> 
>> removes the warning. It seems silly for the GCC people to add warnings
>> for this kind of stuff without a simple way to bypass it...

> Yes, this coding removes the warning.

Oh, good, that seems like a reasonable change to make (it's arguably
more clear than the original anyway).

Is this the only place where the warning shows up?  ISTM there's quite
a lot of code that uses "if (ptr)" for a NULL-ness check.
        regards, tom lane


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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: pgsql: Improve our private implementation of cbrt() to give results of
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: 2x compile warning