Avoid compiler warnings due to possibly unused variables
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 16 Jun 2011 20:38:46 +0000 (23:38 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 16 Jun 2011 20:43:56 +0000 (23:43 +0300)
gcc 4.6 complains about these because of the new option
-Wunused-but-set-variable which comes in with -Wall, so cast them to
void, which avoids the warning.

src/backend/nodes/read.c
src/backend/nodes/readfuncs.c

index 78775e8bbd38b53a743685c3b2720c2afdef492a..ec8e87b7c1d8a49645c86ada6e85d778f7cbf3d5 100644 (file)
@@ -224,6 +224,7 @@ nodeTokenType(char *token, int length)
 
        errno = 0;
        val = strtol(token, &endptr, 10);
+       (void) val;             /* avoid compiler warning if unused */
        if (endptr != token + length || errno == ERANGE
 #ifdef HAVE_LONG_INT_64
        /* if long > 32 bits, check for overflow of int4 */
index 22885147cfbc626b2c8d0ca02842a046a76924c8..29a0e8fe3baebf73cf76f8cf606805e731022e8c 100644 (file)
@@ -48,7 +48,8 @@
 /* And a few guys need only the pg_strtok support fields */
 #define READ_TEMP_LOCALS() \
    char       *token;      \
-   int         length
+   int         length;     \
+   (void) token /* possibly unused */
 
 /* ... but most need both */
 #define READ_LOCALS(nodeTypeName)          \