|
From: <sv...@va...> - 2011-03-28 16:26:54
|
Author: sewardj
Date: 2011-03-28 17:26:42 +0100 (Mon, 28 Mar 2011)
New Revision: 11673
Log:
Fix up most but not all warnings generated by gcc-4.6 about
dead assignments ("[-Wunused-but-set-variable]").
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/readpdb.c
trunk/coregrind/m_debuginfo/readstabs.c
trunk/coregrind/m_debuglog.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_machine.c
trunk/coregrind/m_main.c
trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_ume/elf.c
trunk/coregrind/vg_preloaded.c
trunk/drd/drd_pthread_intercepts.c
trunk/drd/drd_qtcore_intercepts.c
trunk/exp-dhat/dh_main.c
trunk/helgrind/hg_intercepts.c
trunk/memcheck/mc_replace_strmem.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -3410,7 +3410,6 @@
/* This is a derivation of consider_vars_in_frame() above. */
Word i;
DebugInfo* di;
- RegSummary regs;
Bool debug = False;
XArray* res = VG_(newXA)( ML_(dinfo_zalloc), "di.debuginfo.dgsbai.1",
@@ -3462,9 +3461,6 @@
variables on each such address range found are in scope right
now. Don't descend to level zero as that is the global
scope. */
- regs.ip = ip;
- regs.sp = 0;
- regs.fp = 0;
/* "for each scope, working outwards ..." */
for (i = VG_(sizeXA)(di->varinfo) - 1; i >= 1; i--) {
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -990,7 +990,7 @@
UInt acode, abcode;
ULong atoffs, blklen;
Int level;
- UShort ver;
+ /* UShort ver; */
UChar addr_size;
UChar* p = unitblock_img;
@@ -1007,7 +1007,7 @@
p += ui->dw64 ? 12 : 4;
/* version should be 2, 3 or 4 */
- ver = *((UShort*)p);
+ /* ver = *((UShort*)p); */
p += 2;
/* get offset in abbrev */
Modified: trunk/coregrind/m_debuginfo/readpdb.c
===================================================================
--- trunk/coregrind/m_debuginfo/readpdb.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_debuginfo/readpdb.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -2101,21 +2101,21 @@
*/
file = symbols_image + header_size;
while ( file - symbols_image < header_size + symbols.module_size ) {
- int file_nr, file_index, symbol_size, lineno_size;
+ int file_nr, /* file_index, */ symbol_size, lineno_size;
char *file_name;
if ( symbols.version < 19970000 ) {
PDB_SYMBOL_FILE *sym_file = (PDB_SYMBOL_FILE *) file;
file_nr = sym_file->file;
file_name = sym_file->filename;
- file_index = sym_file->range.index;
+ /* file_index = sym_file->range.index; */ /* UNUSED */
symbol_size = sym_file->symbol_size;
lineno_size = sym_file->lineno_size;
} else {
PDB_SYMBOL_FILE_EX *sym_file = (PDB_SYMBOL_FILE_EX *) file;
file_nr = sym_file->file;
file_name = sym_file->filename;
- file_index = sym_file->range.index;
+ /* file_index = sym_file->range.index; */ /* UNUSED */
symbol_size = sym_file->symbol_size;
lineno_size = sym_file->lineno_size;
}
Modified: trunk/coregrind/m_debuginfo/readstabs.c
===================================================================
--- trunk/coregrind/m_debuginfo/readstabs.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_debuginfo/readstabs.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -326,13 +326,11 @@
case N_FUN: { /* function start/end */
Addr addr = 0; /* end address for prev line/scope */
- Bool newfunc = False;
/* if this the end of the function or we haven't
previously finished the previous function... */
if (*string == '\0' || func.start != 0) {
/* end of function */
- newfunc = False;
line.first = False;
/* end line at end of function */
@@ -346,7 +344,6 @@
if (*string != '\0') {
/* new function */
- newfunc = True;
line.first = True;
/* line ends at start of next function */
Modified: trunk/coregrind/m_debuglog.c
===================================================================
--- trunk/coregrind/m_debuglog.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_debuglog.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -1013,7 +1013,7 @@
void VG_(debugLog) ( Int level, const HChar* modulename,
const HChar* format, ... )
{
- UInt ret, pid;
+ UInt pid;
Int indent, depth, i;
va_list vargs;
printf_buf buf;
@@ -1045,7 +1045,7 @@
va_start(vargs,format);
- ret = VG_(debugLog_vprintf) ( add_to_buf, &buf, format, vargs );
+ (void) VG_(debugLog_vprintf) ( add_to_buf, &buf, format, vargs );
if (buf.n > 0) {
emit( buf.buf, local_strlen(buf.buf) );
Modified: trunk/coregrind/m_libcprint.c
===================================================================
--- trunk/coregrind/m_libcprint.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_libcprint.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -233,14 +233,13 @@
UInt VG_(vsnprintf) ( Char* buf, Int size, const HChar *format, va_list vargs )
{
- Int ret;
snprintf_buf_t b;
b.buf = buf;
b.buf_size = size < 0 ? 0 : size;
b.buf_used = 0;
- ret = VG_(debugLog_vprintf)
- ( add_to__snprintf_buf, &b, format, vargs );
+ (void) VG_(debugLog_vprintf)
+ ( add_to__snprintf_buf, &b, format, vargs );
return b.buf_used;
}
Modified: trunk/coregrind/m_machine.c
===================================================================
--- trunk/coregrind/m_machine.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_machine.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -506,7 +506,7 @@
#if defined(VGA_x86)
{ Bool have_sse1, have_sse2, have_cx8, have_lzcnt;
- UInt eax, ebx, ecx, edx, max_basic, max_extended;
+ UInt eax, ebx, ecx, edx, max_extended;
UChar vstr[13];
vstr[0] = 0;
@@ -521,7 +521,6 @@
/* Get processor ID string, and max basic/extended index
values. */
- max_basic = eax;
VG_(memcpy)(&vstr[0], &ebx, 4);
VG_(memcpy)(&vstr[4], &edx, 4);
VG_(memcpy)(&vstr[8], &ecx, 4);
@@ -575,9 +574,9 @@
}
#elif defined(VGA_amd64)
- { Bool have_sse1, have_sse2, have_sse3, have_cx8, have_cx16;
+ { Bool have_sse3, have_cx8, have_cx16;
Bool have_lzcnt;
- UInt eax, ebx, ecx, edx, max_basic, max_extended;
+ UInt eax, ebx, ecx, edx, max_extended;
UChar vstr[13];
vstr[0] = 0;
@@ -592,7 +591,6 @@
/* Get processor ID string, and max basic/extended index
values. */
- max_basic = eax;
VG_(memcpy)(&vstr[0], &ebx, 4);
VG_(memcpy)(&vstr[4], &edx, 4);
VG_(memcpy)(&vstr[8], &ecx, 4);
@@ -604,8 +602,7 @@
/* get capabilities bits into edx */
VG_(cpuid)(1, &eax, &ebx, &ecx, &edx);
- have_sse1 = (edx & (1<<25)) != 0; /* True => have sse insns */
- have_sse2 = (edx & (1<<26)) != 0; /* True => have sse2 insns */
+ // we assume that SSE1 and SSE2 are available by default
have_sse3 = (ecx & (1<<0)) != 0; /* True => have sse3 insns */
// ssse3 is ecx:9
// sse41 is ecx:19
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_main.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -1811,8 +1811,7 @@
nul[0] = 0;
exename = VG_(args_the_exename) ? VG_(args_the_exename)
: "unknown_exename";
- VG_(write)(fd, VG_(args_the_exename),
- VG_(strlen)( VG_(args_the_exename) ));
+ VG_(write)(fd, exename, VG_(strlen)( exename ));
VG_(write)(fd, nul, 1);
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
Modified: trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
===================================================================
--- trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -850,7 +850,7 @@
__attribute__((constructor))
static void init(void)
{
- int res;
+ int res __attribute__((unused));
// This doesn't look thread-safe, but it should be ok... Bart says:
//
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_signals.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -1414,8 +1414,10 @@
VG_(sigprocmask)(VKI_SIG_UNBLOCK, &mask, &origmask);
r = VG_(kill)(VG_(getpid)(), sigNo);
+# if defined(VGO_linux)
/* This sometimes fails with EPERM on Darwin. I don't know why. */
- /* vg_assert(r == 0); */
+ vg_assert(r == 0);
+# endif
VG_(convert_sigaction_fromK_to_toK)( &origsa, &origsa2 );
VG_(sigaction)(sigNo, &origsa2, NULL);
Modified: trunk/coregrind/m_translate.c
===================================================================
--- trunk/coregrind/m_translate.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_translate.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -1258,8 +1258,7 @@
Addr64 addr;
T_Kind kind;
Int tmpbuf_used, verbosity, i;
- Bool notrace_until_done, do_self_check;
- UInt notrace_until_limit = 0;
+ Bool do_self_check;
Bool (*preamble_fn)(void*,IRSB*);
VexArch vex_arch;
VexArchInfo vex_archinfo;
@@ -1320,15 +1319,6 @@
addr, name2 );
}
- /* If codegen tracing, don't start tracing until
- notrace_until_limit blocks have gone by. This avoids printing
- huge amounts of useless junk when all we want to see is the last
- few blocks translated prior to a failure. Set
- notrace_until_limit to be the number of translations to be made
- before --trace-codegen= style printing takes effect. */
- notrace_until_done
- = VG_(get_bbs_translated)() >= notrace_until_limit;
-
if (!debugging_translation)
VG_TRACK( pre_mem_read, Vg_CoreTranslate,
tid, "(translator)", addr, 1 );
Modified: trunk/coregrind/m_ume/elf.c
===================================================================
--- trunk/coregrind/m_ume/elf.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/m_ume/elf.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -305,7 +305,7 @@
ESZ(Addr) maxaddr = 0; /* highest mapped address */
ESZ(Addr) interp_addr = 0; /* interpreter (ld.so) address */
ESZ(Word) interp_size = 0; /* interpreter size */
- ESZ(Word) interp_align = VKI_PAGE_SIZE;
+ /* ESZ(Word) interp_align = VKI_PAGE_SIZE; */ /* UNUSED */
Int i;
void *entry;
ESZ(Addr) ebase = 0;
@@ -395,7 +395,7 @@
if (!baseaddr_set) {
interp_addr = iph->p_vaddr;
- interp_align = iph->p_align;
+ /* interp_align = iph->p_align; */ /* UNUSED */
baseaddr_set = 1;
}
@@ -504,6 +504,7 @@
#else
info->init_ip = (Addr)entry;
info->init_toc = 0; /* meaningless on this platform */
+ (void) interp_offset; /* stop gcc complaining it is unused */
#endif
VG_(free)(e->p);
VG_(free)(e);
Modified: trunk/coregrind/vg_preloaded.c
===================================================================
--- trunk/coregrind/vg_preloaded.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/coregrind/vg_preloaded.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -56,7 +56,7 @@
void VG_NOTIFY_ON_LOAD(freeres)( void );
void VG_NOTIFY_ON_LOAD(freeres)( void )
{
- int res;
+ int res __attribute__((unused));
#if !defined(__UCLIBC__) && !defined(VGO_aix5)
extern void __libc_freeres(void);
__libc_freeres();
@@ -77,7 +77,7 @@
{
OrigFn fn;
Addr result = 0;
- int res;
+ int res __attribute__((unused));
/* Call the original indirect function and get it's result */
VALGRIND_GET_ORIG_FN(fn);
Modified: trunk/drd/drd_pthread_intercepts.c
===================================================================
--- trunk/drd/drd_pthread_intercepts.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/drd/drd_pthread_intercepts.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -235,7 +235,7 @@
*/
static void DRD_(set_joinable)(const pthread_t tid, const int joinable)
{
- int res;
+ int res __attribute__((unused));
assert(joinable == 0 || joinable == 1);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__SET_JOINABLE,
tid, joinable, 0, 0, 0);
@@ -244,7 +244,7 @@
/** Tell DRD that the calling thread is about to enter pthread_create(). */
static __always_inline void DRD_(entering_pthread_create)(void)
{
- int res;
+ int res __attribute__((unused));
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__ENTERING_PTHREAD_CREATE,
0, 0, 0, 0, 0);
}
@@ -252,7 +252,7 @@
/** Tell DRD that the calling thread has left pthread_create(). */
static __always_inline void DRD_(left_pthread_create)(void)
{
- int res;
+ int res __attribute__((unused));
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__LEFT_PTHREAD_CREATE,
0, 0, 0, 0, 0);
}
@@ -263,7 +263,7 @@
*/
static void* DRD_(thread_wrapper)(void* arg)
{
- int res;
+ int res __attribute__((unused));
DrdPosixThreadArgs* arg_ptr;
DrdPosixThreadArgs arg_copy;
@@ -348,7 +348,7 @@
*/
static void DRD_(set_main_thread_state)(void)
{
- int res;
+ int res __attribute__((unused));
// Make sure that DRD knows about the main thread's POSIX thread ID.
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREADID,
@@ -377,7 +377,7 @@
int pthread_create_intercept(pthread_t* thread, const pthread_attr_t* attr,
void* (*start)(void*), void* arg)
{
- int res;
+ int res __attribute__((unused));
int ret;
OrigFn fn;
DrdPosixThreadArgs thread_args;
@@ -428,7 +428,7 @@
int pthread_join_intercept(pthread_t pt_joinee, void **thread_return)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
@@ -467,7 +467,7 @@
static __always_inline
int pthread_cancel_intercept(pthread_t pt_thread)
{
- int res;
+ int res __attribute__((unused));
int ret;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
@@ -509,7 +509,7 @@
const pthread_mutexattr_t* attr)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
int mt;
VALGRIND_GET_ORIG_FN(fn);
@@ -533,7 +533,7 @@
int pthread_mutex_destroy_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
@@ -551,7 +551,7 @@
int pthread_mutex_lock_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -569,7 +569,7 @@
int pthread_mutex_trylock_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -588,7 +588,7 @@
const struct timespec *abs_timeout)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -607,7 +607,7 @@
int pthread_mutex_unlock_intercept(pthread_mutex_t *mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1,
@@ -628,7 +628,7 @@
const pthread_condattr_t* attr)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_INIT,
@@ -647,7 +647,7 @@
int pthread_cond_destroy_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_DESTROY,
@@ -665,7 +665,7 @@
int pthread_cond_wait_intercept(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_WAIT,
@@ -686,7 +686,7 @@
const struct timespec* abstime)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_WAIT,
@@ -712,7 +712,7 @@
int pthread_cond_signal_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_SIGNAL,
@@ -730,7 +730,7 @@
int pthread_cond_broadcast_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_BROADCAST,
@@ -749,7 +749,7 @@
int pthread_spin_init_intercept(pthread_spinlock_t *spinlock, int pshared)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
@@ -767,7 +767,7 @@
int pthread_spin_destroy_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
@@ -785,7 +785,7 @@
int pthread_spin_lock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -803,7 +803,7 @@
int pthread_spin_trylock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -821,7 +821,7 @@
int pthread_spin_unlock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
@@ -844,7 +844,7 @@
unsigned count)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_INIT,
@@ -863,7 +863,7 @@
int pthread_barrier_destroy_intercept(pthread_barrier_t* barrier)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_DESTROY,
@@ -881,7 +881,7 @@
int pthread_barrier_wait_intercept(pthread_barrier_t* barrier)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_WAIT,
@@ -903,7 +903,7 @@
int sem_init_intercept(sem_t *sem, int pshared, unsigned int value)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_INIT,
@@ -921,7 +921,7 @@
int sem_destroy_intercept(sem_t *sem)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_DESTROY,
@@ -939,7 +939,7 @@
unsigned int value)
{
sem_t *ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_OPEN,
@@ -958,7 +958,7 @@
static __always_inline int sem_close_intercept(sem_t *sem)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_CLOSE,
@@ -974,7 +974,7 @@
static __always_inline int sem_wait_intercept(sem_t *sem)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
@@ -990,7 +990,7 @@
static __always_inline int sem_trywait_intercept(sem_t *sem)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
@@ -1007,7 +1007,7 @@
int sem_timedwait_intercept(sem_t *sem, const struct timespec *abs_timeout)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
@@ -1025,7 +1025,7 @@
static __always_inline int sem_post_intercept(sem_t *sem)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_POST,
@@ -1043,7 +1043,7 @@
const pthread_rwlockattr_t* attr)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_INIT,
@@ -1061,7 +1061,7 @@
int pthread_rwlock_destroy_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(ret, fn, rwlock);
@@ -1078,7 +1078,7 @@
int pthread_rwlock_rdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
@@ -1097,7 +1097,7 @@
int pthread_rwlock_wrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
@@ -1116,7 +1116,7 @@
int pthread_rwlock_timedrdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
@@ -1135,7 +1135,7 @@
int pthread_rwlock_timedwrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
@@ -1154,7 +1154,7 @@
int pthread_rwlock_tryrdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
@@ -1173,7 +1173,7 @@
int pthread_rwlock_trywrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
@@ -1192,7 +1192,7 @@
int pthread_rwlock_unlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_UNLOCK,
Modified: trunk/drd/drd_qtcore_intercepts.c
===================================================================
--- trunk/drd/drd_qtcore_intercepts.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/drd/drd_qtcore_intercepts.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -90,7 +90,7 @@
qt_mutex_mode mode)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_INIT,
@@ -106,7 +106,7 @@
qt_mutex_mode mode)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_INIT,
@@ -121,7 +121,7 @@
void* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
@@ -136,7 +136,7 @@
void** mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
@@ -151,7 +151,7 @@
void* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -166,7 +166,7 @@
void* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -183,7 +183,7 @@
int timeout_ms)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
@@ -199,7 +199,7 @@
void* mutex)
{
int ret;
- int res;
+ int res __attribute__((unused));
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1,
Modified: trunk/exp-dhat/dh_main.c
===================================================================
--- trunk/exp-dhat/dh_main.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/exp-dhat/dh_main.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -452,7 +452,7 @@
Bool is_zeroed )
{
tl_assert(p == NULL); // don't handle custom allocators right now
- SizeT actual_szB, slop_szB;
+ SizeT actual_szB /*, slop_szB*/;
if ((SSizeT)req_szB < 0) return NULL;
@@ -468,9 +468,9 @@
if (is_zeroed) VG_(memset)(p, 0, req_szB);
actual_szB = VG_(malloc_usable_size)(p);
tl_assert(actual_szB >= req_szB);
- slop_szB = actual_szB - req_szB;
+ /* slop_szB = actual_szB - req_szB; */
} else {
- slop_szB = 0;
+ /* slop_szB = 0; */
}
// Make new HP_Chunk node, add to malloc_list
Modified: trunk/helgrind/hg_intercepts.c
===================================================================
--- trunk/helgrind/hg_intercepts.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/helgrind/hg_intercepts.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -86,7 +86,8 @@
#define DO_CREQ_v_W(_creqF, _ty1F,_arg1F) \
do { \
- Word _unused_res, _arg1; \
+ Word _unused_res __attribute__((unused)); \
+ Word _arg1; \
assert(sizeof(_ty1F) == sizeof(Word)); \
_arg1 = (Word)(_arg1F); \
VALGRIND_DO_CLIENT_REQUEST(_unused_res, 0, \
@@ -96,7 +97,8 @@
#define DO_CREQ_v_WW(_creqF, _ty1F,_arg1F, _ty2F,_arg2F) \
do { \
- Word _unused_res, _arg1, _arg2; \
+ Word _unused_res __attribute__((unused)); \
+ Word _arg1, _arg2; \
assert(sizeof(_ty1F) == sizeof(Word)); \
assert(sizeof(_ty2F) == sizeof(Word)); \
_arg1 = (Word)(_arg1F); \
@@ -106,7 +108,8 @@
_arg1,_arg2,0,0,0); \
} while (0)
-#define DO_CREQ_W_WW(_resF, _creqF, _ty1F,_arg1F, _ty2F,_arg2F) \
+#define DO_CREQ_W_WW(_resF, _creqF, _ty1F,_arg1F, \
+ _ty2F,_arg2F) \
do { \
Word _res, _arg1, _arg2; \
assert(sizeof(_ty1F) == sizeof(Word)); \
@@ -122,7 +125,8 @@
#define DO_CREQ_v_WWW(_creqF, _ty1F,_arg1F, \
_ty2F,_arg2F, _ty3F, _arg3F) \
do { \
- Word _unused_res, _arg1, _arg2, _arg3; \
+ Word _unused_res __attribute__((unused)); \
+ Word _arg1, _arg2, _arg3; \
assert(sizeof(_ty1F) == sizeof(Word)); \
assert(sizeof(_ty2F) == sizeof(Word)); \
assert(sizeof(_ty3F) == sizeof(Word)); \
Modified: trunk/memcheck/mc_replace_strmem.c
===================================================================
--- trunk/memcheck/mc_replace_strmem.c 2011-03-28 13:51:41 UTC (rev 11672)
+++ trunk/memcheck/mc_replace_strmem.c 2011-03-28 16:26:42 UTC (rev 11673)
@@ -91,7 +91,7 @@
// extra function in the stack trace.
#define RECORD_OVERLAP_ERROR(s, src, dst, len) \
{ \
- Word unused_res; \
+ Word unused_res __attribute__((unused)); \
VALGRIND_DO_CLIENT_REQUEST(unused_res, 0, \
_VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR, \
s, src, dst, len, 0); \
|