Permalink
Browse files

Fix #284384 (clang 3.1 -Wunused-value warnings in valgrind.h,

memcheck.h) by changing a bunch of VALGRIND_DO_CLIENT_REQUEST_EXPR
into VALGRIND_DO_CLIENT_REQUEST_STMT for cases where the return value
of the former would be unused.  (Bart Van Assche, bart.vanassche@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12226 a5019735-40e9-0310-863c-91ae7b9d1cf9
  • Loading branch information...
1 parent 3bbaf48 commit 4b3a74204894e943c43cb8e8aae39d813040702c sewardj committed Oct 24, 2011
View
@@ -83,36 +83,36 @@ typedef
/* Dump current state of cost centers, and zero them afterwards */
#define CALLGRIND_DUMP_STATS \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DUMP_STATS, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS, \
0, 0, 0, 0, 0)
/* Dump current state of cost centers, and zero them afterwards.
The argument is appended to a string stating the reason which triggered
the dump. This string is written as a description field into the
profile data dump. */
#define CALLGRIND_DUMP_STATS_AT(pos_str) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DUMP_STATS_AT, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS_AT, \
pos_str, 0, 0, 0, 0)
/* Zero cost centers */
#define CALLGRIND_ZERO_STATS \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__ZERO_STATS, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ZERO_STATS, \
0, 0, 0, 0, 0)
/* Toggles collection state.
The collection state specifies whether the happening of events
should be noted or if they are to be ignored. Events are noted
by increment of counters in a cost center */
-#define CALLGRIND_TOGGLE_COLLECT \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__TOGGLE_COLLECT, \
+#define CALLGRIND_TOGGLE_COLLECT \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__TOGGLE_COLLECT, \
0, 0, 0, 0, 0)
/* Start full callgrind instrumentation if not already switched on.
When cache simulation is done, it will flush the simulated cache;
this will lead to an artifical cache warmup phase afterwards with
cache misses which would not have happened in reality. */
-#define CALLGRIND_START_INSTRUMENTATION \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__START_INSTRUMENTATION, \
+#define CALLGRIND_START_INSTRUMENTATION \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__START_INSTRUMENTATION, \
0, 0, 0, 0, 0)
/* Stop full callgrind instrumentation if not already switched off.
@@ -122,8 +122,8 @@ typedef
Use this to bypass Callgrind aggregation for uninteresting code parts.
To start Callgrind in this mode to ignore the setup phase, use
the option "--instr-atstart=no". */
-#define CALLGRIND_STOP_INSTRUMENTATION \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__STOP_INSTRUMENTATION, \
+#define CALLGRIND_STOP_INSTRUMENTATION \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STOP_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#endif /* __CALLGRIND_H */
@@ -1035,7 +1035,7 @@ static void init(void)
init_done = 1;
- VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__GET_MALLOCFUNCS, &info,
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__GET_MALLOCFUNCS, &info,
0, 0, 0, 0);
}
@@ -60,8 +60,7 @@ void VG_NOTIFY_ON_LOAD(freeres)( void )
extern void __libc_freeres(void);
__libc_freeres();
# endif
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default */,
- VG_USERREQ__LIBC_FREERES_DONE,
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__LIBC_FREERES_DONE,
0, 0, 0, 0, 0);
/*NOTREACHED*/
*(volatile int *)0 = 'x';
@@ -85,7 +84,7 @@ void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) (void)
code which runs on the emulated CPU) to update the redirection that
led to this function. This client request eventually gives control to
the function VG_(redir_add_ifunc_target) in m_redir.c */
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__ADD_IFUNC_TARGET,
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ADD_IFUNC_TARGET,
fn.nraddr, result, 0, 0, 0);
return (void*)result;
}
View
@@ -82,16 +82,16 @@
#define DRD_IGNORE_VAR(x) ANNOTATE_BENIGN_RACE_SIZED(&(x), sizeof(x), "")
/** Tell DRD to no longer ignore data races for the specified variable. */
-#define DRD_STOP_IGNORING_VAR(x) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_FINISH_SUPPRESSION, \
+#define DRD_STOP_IGNORING_VAR(x) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_FINISH_SUPPRESSION, \
&(x), sizeof(x), 0, 0, 0)
/**
* Tell DRD to trace all memory accesses on the specified variable.
* until the memory that was allocated for the variable is freed.
*/
-#define DRD_TRACE_VAR(x) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_START_TRACE_ADDR, \
+#define DRD_TRACE_VAR(x) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_START_TRACE_ADDR, \
&(x), sizeof(x), 0, 0, 0)
/**
@@ -107,9 +107,8 @@
* Tell DRD to insert a happens-before mark. addr is the address of an object
* that is not a pthread synchronization object.
*/
-#define ANNOTATE_HAPPENS_BEFORE(addr) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE, \
+#define ANNOTATE_HAPPENS_BEFORE(addr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE, \
addr, 0, 0, 0, 0)
/**
@@ -120,9 +119,8 @@
* before any other thread has passed by a happens-before annotation for the
* same address is an error.
*/
-#define ANNOTATE_HAPPENS_AFTER(addr) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER, \
+#define ANNOTATE_HAPPENS_AFTER(addr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER, \
addr, 0, 0, 0, 0)
/**
@@ -179,25 +177,22 @@
#define ANNOTATE_SWAP_MEMORY_RANGE(addr, size) do { } while(0)
/** Tell DRD that a reader-writer lock object has been initialized. */
-#define ANNOTATE_RWLOCK_CREATE(rwlock) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE, \
+#define ANNOTATE_RWLOCK_CREATE(rwlock) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE, \
rwlock, 0, 0, 0, 0);
/** Tell DRD that a reader-writer lock object has been destroyed. */
-#define ANNOTATE_RWLOCK_DESTROY(rwlock) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY, \
+#define ANNOTATE_RWLOCK_DESTROY(rwlock) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY, \
rwlock, 0, 0, 0, 0);
/**
* Tell DRD that a reader-writer lock has been acquired. is_w == 1 means that
* a write lock has been obtained, is_w == 0 means that a read lock has been
* obtained.
*/
-#define ANNOTATE_RWLOCK_ACQUIRED(rwlock, is_w) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED, \
+#define ANNOTATE_RWLOCK_ACQUIRED(rwlock, is_w) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED, \
rwlock, is_w, 0, 0, 0)
/**
@@ -218,8 +213,7 @@
* is about to be released.
*/
#define ANNOTATE_RWLOCK_RELEASED(rwlock, is_w) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
- VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED, \
rwlock, is_w, 0, 0, 0);
/**
@@ -238,27 +232,27 @@
* is, whether or not it is allowed to call barrier_init() several times
* without calling barrier_destroy().
*/
-#define ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_ANNOTATION_UNIMP, \
- "ANNOTATE_BARRIER_INIT", barrier, \
+#define ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP, \
+ "ANNOTATE_BARRIER_INIT", barrier, \
count, reinitialization_allowed, 0)
/* Report that a barrier has been destroyed. */
-#define ANNOTATE_BARRIER_DESTROY(barrier) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_ANNOTATION_UNIMP, \
- "ANNOTATE_BARRIER_DESTROY", \
+#define ANNOTATE_BARRIER_DESTROY(barrier) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP, \
+ "ANNOTATE_BARRIER_DESTROY", \
barrier, 0, 0, 0)
/* Report that the calling thread is about to start waiting for a barrier. */
-#define ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_ANNOTATION_UNIMP, \
- "ANNOTATE_BARRIER_WAIT_BEFORE", \
+#define ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP, \
+ "ANNOTATE_BARRIER_WAIT_BEFORE", \
barrier, 0, 0, 0)
/* Report that the calling thread has just finished waiting for a barrier. */
-#define ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_ANNOTATION_UNIMP, \
- "ANNOTATE_BARRIER_WAIT_AFTER", \
+#define ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP, \
+ "ANNOTATE_BARRIER_WAIT_AFTER", \
barrier, 0, 0, 0)
/**
@@ -295,29 +289,29 @@
/* Same as ANNOTATE_BENIGN_RACE(addr, descr), but applies to
the memory range [addr, addr + size). */
-#define ANNOTATE_BENIGN_RACE_SIZED(addr, size, descr) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_START_SUPPRESSION, \
+#define ANNOTATE_BENIGN_RACE_SIZED(addr, size, descr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_START_SUPPRESSION, \
addr, size, 0, 0, 0)
/** Tell DRD to ignore all reads performed by the current thread. */
#define ANNOTATE_IGNORE_READS_BEGIN() \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_RECORD_LOADS, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_LOADS, \
0, 0, 0, 0, 0);
/** Tell DRD to no longer ignore the reads performed by the current thread. */
#define ANNOTATE_IGNORE_READS_END() \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_RECORD_LOADS, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_LOADS, \
1, 0, 0, 0, 0);
/** Tell DRD to ignore all writes performed by the current thread. */
#define ANNOTATE_IGNORE_WRITES_BEGIN() \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_RECORD_STORES, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_STORES, \
0, 0, 0, 0, 0)
/** Tell DRD to no longer ignore the writes performed by the current thread. */
#define ANNOTATE_IGNORE_WRITES_END() \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_RECORD_STORES, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_STORES, \
1, 0, 0, 0, 0)
/** Tell DRD to ignore all memory accesses performed by the current thread. */
@@ -335,8 +329,8 @@
* Tell DRD that size bytes starting at addr has been allocated by a custom
* memory allocator.
*/
-#define ANNOTATE_NEW_MEMORY(addr, size) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_CLEAN_MEMORY, \
+#define ANNOTATE_NEW_MEMORY(addr, size) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_CLEAN_MEMORY, \
addr, size, 0, 0, 0)
/** Ask DRD to report every access to the specified address. */
@@ -347,7 +341,7 @@
* be used in error messages printed by DRD.
*/
#define ANNOTATE_THREAD_NAME(name) \
- VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__DRD_SET_THREAD_NAME, \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_SET_THREAD_NAME, \
name, 0, 0, 0, 0)
/*@}*/
Oops, something went wrong.

0 comments on commit 4b3a742

Please sign in to comment.