From ab8e746e796a2626b7c11382b784d4d97c455410 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 24 Jul 2011 07:26:17 -0600 Subject: [PATCH] Fix GCC4.6 warning unused variables --- compat/GnuRegex.c | 3 +++ src/ipcache.cc | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compat/GnuRegex.c b/compat/GnuRegex.c index 5b93185ba4..983f4514fe 100644 --- a/compat/GnuRegex.c +++ b/compat/GnuRegex.c @@ -3730,6 +3730,9 @@ on_failure: POP_FAILURE_POINT(sdummy, pdummy, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); + /* avoid GCC 4.6 set but unused variables warning. Does not matter here. */ + if (pdummy || sdummy) + (void)0; } /* Note fall through. */ diff --git a/src/ipcache.cc b/src/ipcache.cc index 451b1da9cb..95f33d757d 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -652,7 +652,6 @@ ipcacheHandleReply(void *data, char *reply) ipcacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_message) #endif { - int done; ipcache_entry *i; static_cast(data)->unwrap(&i); IpcacheStats.replies++; @@ -660,11 +659,10 @@ ipcacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_m statHistCount(&statCounter.dns.svc_time, age); #if USE_DNSSERVERS - - done = ipcacheParse(i, reply); + ipcacheParse(i, reply); #else - done = ipcacheParse(i, answers, na, error_message); + int done = ipcacheParse(i, answers, na, error_message); /* If we have not produced either IPs or Error immediately, wait for recursion to finish. */ if (done != 0 || error_message != NULL) -- 2.47.2