From: Bart Van Assche Date: Fri, 7 Oct 2011 09:39:56 +0000 (+0000) Subject: Avoid that using any of the VALGRIND_DISABLE_ERROR_REPORTING, X-Git-Tag: svn/VALGRIND_3_7_0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dab1bd66a0e530c7d46a4f9869acf2178f387e4;p=thirdparty%2Fvalgrind.git Avoid that using any of the VALGRIND_DISABLE_ERROR_REPORTING, VALGRIND_ENABLE_ERROR_REPORTING, VALGRIND_DO_ADDED_LEAK_CHECK, VALGRIND_DO_CHANGED_LEAK_CHECK macros causes gcc 4.6 to print a warning message about assigning a value to an unused variable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12110 --- diff --git a/include/valgrind.h b/include/valgrind.h index 7bce103e65..a3669aa000 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -4041,22 +4041,21 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) number of VALGRIND_ENABLE_ERROR_REPORTING calls needed to re-enable reporting. Child threads do not inherit this setting from their parents -- they are always created with reporting enabled. */ -#define VALGRIND_DISABLE_ERROR_REPORTING \ - {unsigned int _qzz_res; \ - VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ - VG_USERREQ__CHANGE_ERR_DISABLEMENT, \ - 1, 0, 0, 0, 0); \ - } +#define VALGRIND_DISABLE_ERROR_REPORTING \ + do { \ + VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \ + VG_USERREQ__CHANGE_ERR_DISABLEMENT, \ + 1, 0, 0, 0, 0); \ + } while (0) /* Re-enable error reporting, as per comments on VALGRIND_DISABLE_ERROR_REPORTING. */ -#define VALGRIND_ENABLE_ERROR_REPORTING \ - {unsigned int _qzz_res; \ - VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ - VG_USERREQ__CHANGE_ERR_DISABLEMENT, \ - (-1), 0, 0, 0, 0); \ - } - +#define VALGRIND_ENABLE_ERROR_REPORTING \ + do { \ + VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \ + VG_USERREQ__CHANGE_ERR_DISABLEMENT, \ + -1, 0, 0, 0, 0); \ + } while (0) #undef PLAT_x86_darwin #undef PLAT_amd64_darwin diff --git a/memcheck/memcheck.h b/memcheck/memcheck.h index 19acca23f2..757dda7a61 100644 --- a/memcheck/memcheck.h +++ b/memcheck/memcheck.h @@ -191,22 +191,22 @@ typedef /* Same as VALGRIND_DO_LEAK_CHECK but only showing the entries for which there was an increase in leaked bytes or leaked nr of blocks since the previous leak search. */ -#define VALGRIND_DO_ADDED_LEAK_CHECK \ - {unsigned long _qzz_res; \ - VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ - VG_USERREQ__DO_LEAK_CHECK, \ - 0, 1, 0, 0, 0); \ - } +#define VALGRIND_DO_ADDED_LEAK_CHECK \ + do { \ + VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \ + VG_USERREQ__DO_LEAK_CHECK, \ + 0, 1, 0, 0, 0); \ + } while (0) /* Same as VALGRIND_DO_ADDED_LEAK_CHECK but showing entries with increased or decreased leaked bytes/blocks since previous leak search. */ -#define VALGRIND_DO_CHANGED_LEAK_CHECK \ - {unsigned long _qzz_res; \ - VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ - VG_USERREQ__DO_LEAK_CHECK, \ - 0, 2, 0, 0, 0); \ - } +#define VALGRIND_DO_CHANGED_LEAK_CHECK \ + do { \ + VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \ + VG_USERREQ__DO_LEAK_CHECK, \ + 0, 2, 0, 0, 0); \ + } while (0) /* Do a summary memory leak check (like --leak-check=summary) mid-execution. */ #define VALGRIND_DO_QUICK_LEAK_CHECK \