Re: 2x compile warning - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 2x compile warning
Date
Msg-id 6727.1145914770@sss.pgh.pa.us
Whole thread Raw
In response to Re: 2x compile warning  (Kris Jurka <books@ejurka.com>)
Responses Re: 2x compile warning  (Martijn van Oosterhout <kleptog@svana.org>)
List 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 by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: pgsql: Improve our private implementation of cbrt() to give results of
Next
From: Martijn van Oosterhout
Date:
Subject: Re: 2x compile warning