Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Suppress compiler warnings in non-cassert builds.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2016 03:21:10 +0000 (23:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2016 03:21:10 +0000 (23:21 -0400)
With Asserts off, these variables are set but never used, resulting
in warnings from pickier compilers.  Fix that with our standard solution.
Per report from Jeff Janes.

src/backend/access/gist/gistutil.c
src/backend/utils/adt/amutils.c

index 26d4a646947819f8b26bc08dc69c9fa645e53c61..887c58b71c9371f7e2eafb44ea85a81ca1d3b5b3 100644 (file)
@@ -852,7 +852,7 @@ gistproperty(Oid index_oid, int attno,
             bool *res, bool *isnull)
 {
    HeapTuple   tuple;
-   Form_pg_index rd_index;
+   Form_pg_index rd_index PG_USED_FOR_ASSERTS_ONLY;
    Form_pg_opclass rd_opclass;
    Datum       datum;
    bool        disnull;
index ad5e45674ba77b6050e107479faff6b11ae845f2..f4844d15062632ae1ddaba3a0a2892a0aa9fc1e2 100644 (file)
@@ -115,7 +115,7 @@ test_indoption(Oid relid, int attno, bool guard,
               bool *res)
 {
    HeapTuple   tuple;
-   Form_pg_index rd_index;
+   Form_pg_index rd_index PG_USED_FOR_ASSERTS_ONLY;
    Datum       datum;
    bool        isnull;
    int2vector *indoption;