]> granicus.if.org Git - postgresql/commitdiff
Remove unnecessary AssertMacro() to suppress gcc 4.6 compiler warning.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Oct 2011 21:39:14 +0000 (17:39 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Oct 2011 21:39:14 +0000 (17:39 -0400)
There's no particular value in doing AssertMacro((tup) != NULL) in front
of code that's certain to crash anyway if tup is NULL.  And if "tup" is
actually the address of a local variable, gcc 4.6 whinges about it.  That's
arguably pretty broken on gcc's part, but we might as well remove the
useless test to silence the warnings.  This gets rid of all the -Waddress
warnings in the backend; there are some in libpq and psql that are a bit
harder to avoid.

src/include/access/htup.h

index c0258354e6f91c92559bf36be752011b9ba8bf32..966e2d0299e95c280a3acaaea257416bfbbbb2ce 100644 (file)
@@ -839,8 +839,6 @@ extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
  * ----------------
  */
 #define heap_getattr(tup, attnum, tupleDesc, isnull) \
-( \
-       AssertMacro((tup) != NULL), \
        ( \
                ((attnum) > 0) ? \
                ( \
@@ -854,8 +852,7 @@ extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
                ) \
                : \
                        heap_getsysattr((tup), (attnum), (tupleDesc), (isnull)) \
-       ) \
-)
+       )
 
 /* prototypes for functions in common/heaptuple.c */
 extern Size heap_compute_data_size(TupleDesc tupleDesc,