Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7357558

Browse files
committed
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.
1 parent dbbba52 commit 7357558

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/backend/nodes/read.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ nodeTokenType(char *token, int length)
224224

225225
errno = 0;
226226
val = strtol(token, &endptr, 10);
227+
(void) val; /* avoid compiler warning if unused */
227228
if (endptr != token + length || errno == ERANGE
228229
#ifdef HAVE_LONG_INT_64
229230
/* if long > 32 bits, check for overflow of int4 */

src/backend/nodes/readfuncs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
/* And a few guys need only the pg_strtok support fields */
4949
#define READ_TEMP_LOCALS() \
5050
char *token; \
51-
int length
51+
int length; \
52+
(void) token /* possibly unused */
5253

5354
/* ... but most need both */
5455
#define READ_LOCALS(nodeTypeName) \

0 commit comments

Comments
 (0)