|
From: <sv...@va...> - 2011-10-07 09:44:42
|
Author: bart
Date: 2011-10-07 10:39:56 +0100 (Fri, 07 Oct 2011)
New Revision: 12110
Log:
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.
Modified:
trunk/include/valgrind.h
trunk/memcheck/memcheck.h
Modified: trunk/include/valgrind.h
===================================================================
--- trunk/include/valgrind.h 2011-10-06 19:09:06 UTC (rev 12109)
+++ trunk/include/valgrind.h 2011-10-07 09:39:56 UTC (rev 12110)
@@ -4041,23 +4041,22 @@
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
#undef PLAT_x86_win32
Modified: trunk/memcheck/memcheck.h
===================================================================
--- trunk/memcheck/memcheck.h 2011-10-06 19:09:06 UTC (rev 12109)
+++ trunk/memcheck/memcheck.h 2011-10-07 09:39:56 UTC (rev 12110)
@@ -191,22 +191,22 @@
/* 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 \
|