From 7357558fc8866e3a449aa9473c419b593d67b5b6 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 16 Jun 2011 23:38:46 +0300 Subject: [PATCH] Avoid compiler warnings due to possibly unused variables 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 | 1 + src/backend/nodes/readfuncs.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c index 78775e8bbd..ec8e87b7c1 100644 --- a/src/backend/nodes/read.c +++ b/src/backend/nodes/read.c @@ -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 */ diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 22885147cf..29a0e8fe3b 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -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) \ -- 2.40.0