From 06f071390697270a8342daeb41cb0fe790f65181 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 4 May 2011 23:19:38 -0700 Subject: Mark valgrind's _qzz_res as unused to silence warnings on gcc 4.6. This applies c11675 by Julian Seward from valgrind trunk (svn://svn.valgrind.org/valgrind/trunk) to rustrt's included copies of memcheck.h and valgrind.h, effectively backporting the fix from the unreleased 3.6.2. The commit simply applies the gcc 'unused' attribute to the relevant declarations. This change allows compilation of the runtime code under gcc 4.6 with -Werror, as the makefile currently requests. --- src/rt/memcheck.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rt/memcheck.h') diff --git a/src/rt/memcheck.h b/src/rt/memcheck.h index bf95491b..58480256 100644 --- a/src/rt/memcheck.h +++ b/src/rt/memcheck.h @@ -184,7 +184,7 @@ typedef /* Do a full memory leak check (like --leak-check=full) mid-execution. */ #define VALGRIND_DO_LEAK_CHECK \ - {unsigned long _qzz_res; \ + {unsigned long _qzz_res __attribute((unused)); \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__DO_LEAK_CHECK, \ 0, 0, 0, 0, 0); \ @@ -192,7 +192,7 @@ typedef /* Do a summary memory leak check (like --leak-check=summary) mid-execution. */ #define VALGRIND_DO_QUICK_LEAK_CHECK \ - {unsigned long _qzz_res; \ + {unsigned long _qzz_res __attribute((unused)); \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__DO_LEAK_CHECK, \ 1, 0, 0, 0, 0); \ @@ -207,7 +207,7 @@ typedef are. We also initialise '_qzz_leaked', etc because VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as defined. */ \ - {unsigned long _qzz_res; \ + {unsigned long _qzz_res __attribute((unused)); \ unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \ unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ @@ -229,7 +229,7 @@ typedef are. We also initialise '_qzz_leaked', etc because VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as defined. */ \ - {unsigned long _qzz_res; \ + {unsigned long _qzz_res __attribute((unused)); \ unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \ unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ -- cgit v1.2.3