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

From Kris Jurka
Subject Re: 2x compile warning
Date
Msg-id Pine.BSO.4.63.0604241247400.20001@leary2.csoft.net
Whole thread Raw
In response to 2x compile warning  (Gevik Babakhani <pgdev@xs4all.nl>)
Responses Re: 2x compile warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: 2x compile warning  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers

On Mon, 24 Apr 2006, Gevik Babakhani wrote:

> I noticed the following compile warnings. Perhaps someone is interested
> to know about them.

Also I was testing a gcc 4.2 snapshot (20060419) and it has a whole lot of 
warnings stemming from heap_getattr's isnull check:

aclchk.c:791: warning: the address of 'isNull', will always evaluate as 
'true'

aclDatum = heap_getattr(tuple, Anum_pg_database_datacl, 
RelationGetDescr(relation), &isNull);


#define heap_getattr(tup, attnum, tupleDesc, isnull) \
( \    AssertMacro((tup) != NULL), \    ( \        ((attnum) > 0) ? \        ( \            ((attnum) > (int)
(tup)->t_data->t_natts)? \            ( \                ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \
   (Datum)NULL \            ) \            : \                fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
  ) \        : \            heap_getsysattr((tup), (attnum), (tupleDesc), (isnull)) \    ) \
 
)

Removing the check for (isnull) before (*(isnull) = true) as in the 
attached patch passes make check, but I have not looked at every 
heap_getattr call site to ensure it's passing a valid isnull pointer.

Kris Jurka

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: bug# 2073 - Clarification
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Regression error on float8