Avoid that using any of the VALGRIND_DISABLE_ERROR_REPORTING,
authorbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Fri, 7 Oct 2011 09:39:56 +0000 (09:39 +0000)
committerbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Fri, 7 Oct 2011 09:39:56 +0000 (09:39 +0000)
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 a5019735-40e9-0310-863c-91ae7b9d1cf9

include/valgrind.h
memcheck/memcheck.h

index 7bce103e65bcd819f6d619780f069d968b78d205..a3669aa0000ba65119e76a6fffb2ca9baf39236d 100644 (file)
@@ -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
index 19acca23f24e7ced7e9297ba22679c96f0359256..757dda7a61d6c54879c8bb879447976839833119 100644 (file)
@@ -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                             \