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