Author: bart
Date: 2011-04-03 18:42:19 +0100 (Sun, 03 Apr 2011)
New Revision: 11682
Log:
Modified:
trunk/drd/tests/annotate_ignore_rw.c
trunk/drd/tests/custom_alloc.c
trunk/drd/tests/sigalrm.c
trunk/drd/tests/tsan_unittest.cpp
trunk/exp-ptrcheck/tests/arith_include2.c
trunk/exp-ptrcheck/tests/hp_bounds.c
trunk/exp-ptrcheck/tests/hp_dangle.c
trunk/exp-ptrcheck/tests/justify.c
trunk/exp-ptrcheck/tests/mm.c
trunk/exp-ptrcheck/tests/partial.c
trunk/exp-ptrcheck/tests/pth_specific.c
trunk/exp-ptrcheck/tests/realloc.c
trunk/exp-ptrcheck/tests/strlen.c
trunk/exp-ptrcheck/tests/unaligned.c
trunk/exp-ptrcheck/tests/zero.c
trunk/helgrind/helgrind.h
trunk/helgrind/tests/tc18_semabuse.c
trunk/massif/tests/realloc.c
trunk/memcheck/tests/error_counts.c
trunk/memcheck/tests/linux/brk.c
trunk/memcheck/tests/linux/stack_switch.c
trunk/memcheck/tests/strchr.c
trunk/memcheck/tests/trivialleak.c
trunk/memcheck/tests/x86-linux/scalar_exit_group.c
trunk/memcheck/tests/x86-linux/scalar_fork.c
trunk/memcheck/tests/x86-linux/scalar_vfork.c
trunk/none/tests/bug129866.c
trunk/none/tests/coolo_sigaction.cpp
trunk/none/tests/linux/mremap2.c
trunk/none/tests/x86/aad_aam.c
trunk/perf/sarp.c
trunk/perf/tinycc.c
Modified: trunk/drd/tests/annotate_ignore_rw.c
===================================================================
--- trunk/drd/tests/annotate_ignore_rw.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/drd/tests/annotate_ignore_rw.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -24,7 +24,6 @@
{
int optchar;
int ign_rw = 1;
- int tmp;
pthread_t tid;
while ((optchar = getopt(argc, argv, "r")) != EOF)
@@ -54,7 +53,7 @@
sleep(1);
/* Read s_c. */
- tmp = s_c;
+ fprintf(stderr, "x" + s_c);
pthread_join(tid, 0);
Modified: trunk/drd/tests/custom_alloc.c
===================================================================
--- trunk/drd/tests/custom_alloc.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/drd/tests/custom_alloc.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -57,7 +57,7 @@
void make_leak(void)
{
- int* array2 = custom_alloc(sizeof(int) * 10);
+ int* array2 __attribute__((unused)) = custom_alloc(sizeof(int) * 10);
array2 = 0; // leak
return;
}
Modified: trunk/drd/tests/sigalrm.c
===================================================================
--- trunk/drd/tests/sigalrm.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/drd/tests/sigalrm.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -55,7 +55,6 @@
int main(int argc, char** argv)
{
- int vgthreadid;
pthread_t threadid;
struct timespec tsDelay;
@@ -63,8 +62,6 @@
if (argc > 1)
s_debug = 1;
- vgthreadid = DRD_GET_VALGRIND_THREADID;
-
print_thread_id("main: ");
{
Modified: trunk/drd/tests/tsan_unittest.cpp
===================================================================
--- trunk/drd/tests/tsan_unittest.cpp 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/drd/tests/tsan_unittest.cpp 2011-04-03 17:42:19 UTC (rev 11682)
@@ -3469,7 +3469,7 @@
n %= Nlog;
long t0 = clock();
- long t = t0;
+ long t __attribute__((unused)) = t0;
for (int it = 0; it < N_iter; it++) {
if(n == 0) {
@@ -5047,7 +5047,7 @@
int GLOB = 0;
void F1() {
- int ar[32];
+ int ar[32] __attribute__((unused));
// ANNOTATE_TRACE_MEMORY(&ar[0]);
// ANNOTATE_TRACE_MEMORY(&ar[31]);
ar[0] = 1;
@@ -5055,7 +5055,7 @@
}
void Worker() {
- int ar[32];
+ int ar[32] __attribute__((unused));
// ANNOTATE_TRACE_MEMORY(&ar[0]);
// ANNOTATE_TRACE_MEMORY(&ar[31]);
ar[0] = 1;
Modified: trunk/exp-ptrcheck/tests/arith_include2.c
===================================================================
--- trunk/exp-ptrcheck/tests/arith_include2.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/arith_include2.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -15,7 +15,7 @@
struct sigaction sigsegv;
// Scratch values
- long a, tn;
+ long a, tn __attribute__((unused));
long* tp;
// Known pointers
Modified: trunk/exp-ptrcheck/tests/hp_bounds.c
===================================================================
--- trunk/exp-ptrcheck/tests/hp_bounds.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/hp_bounds.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -2,7 +2,7 @@
int main(void)
{
- int y;
+ int y __attribute__((unused));
int* x = malloc(sizeof(int) * 100);
y = x[95]; // ok
Modified: trunk/exp-ptrcheck/tests/hp_dangle.c
===================================================================
--- trunk/exp-ptrcheck/tests/hp_dangle.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/hp_dangle.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -11,7 +11,7 @@
int main(void)
{
- int y;
+ int y __attribute__((unused));
int* x = mk_dangle();
y = x[5];
Modified: trunk/exp-ptrcheck/tests/justify.c
===================================================================
--- trunk/exp-ptrcheck/tests/justify.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/justify.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -10,7 +10,7 @@
int main ( void )
{
- char c;
+ char c __attribute__((unused));
char *c0, *c1;
c0 = malloc(10000);
Modified: trunk/exp-ptrcheck/tests/mm.c
===================================================================
--- trunk/exp-ptrcheck/tests/mm.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/mm.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -15,7 +15,7 @@
{
struct sigaction sigsegv;
- char c;
+ char c __attribute__((unused));
// This fails due to a bad fd (at one point I was not handling failing
// mmap() calls, and would have got a seg fault).
Modified: trunk/exp-ptrcheck/tests/partial.c
===================================================================
--- trunk/exp-ptrcheck/tests/partial.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/partial.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -3,12 +3,17 @@
int main ( void )
{
- int* x3 = malloc(3); float f, *f3 = malloc(3);
- int* x4 = malloc(4); double d, *d7 = malloc(7);
- int* x5 = malloc(5); long long int lli, *lli7 = malloc(7);
- int* x6 = malloc(6); char c, *c0 = malloc(0);
- int* x7 = malloc(7); short int s, *s1 = malloc(1);
- int x;
+ int* x3 = malloc(3);
+ float f __attribute__((unused)), *f3 = malloc(3);
+ int* x4 = malloc(4);
+ double d __attribute__((unused)), *d7 = malloc(7);
+ int* x5 = malloc(5);
+ long long int lli __attribute__((unused)), *lli7 = malloc(7);
+ int* x6 = malloc(6);
+ char c __attribute__((unused)), *c0 = malloc(0);
+ int* x7 = malloc(7);
+ short int s __attribute__((unused)), *s1 = malloc(1);
+ int x __attribute__((unused));
int* y4 = malloc(4);
int* y5 = malloc(5);
int* y6 = malloc(6);
Modified: trunk/exp-ptrcheck/tests/pth_specific.c
===================================================================
--- trunk/exp-ptrcheck/tests/pth_specific.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/pth_specific.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -12,7 +12,7 @@
{
pthread_key_t key;
char *x, *z;
- char y;
+ char y __attribute__((unused));
x = malloc(100);
Modified: trunk/exp-ptrcheck/tests/realloc.c
===================================================================
--- trunk/exp-ptrcheck/tests/realloc.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/realloc.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -3,11 +3,11 @@
int main(void)
{
- int i;
- int* y;
+ int i __attribute__((unused));
+ int* y __attribute__((unused));
int** x = malloc(sizeof(int*) * 100);
int* x2 = malloc(sizeof(int) * 100);
- void* sink;
+ void* sink __attribute__((unused));
x[0] = x2; // this is to check the pointerness is copied across ok
x[49] = x2; // this is to check the pointerness is copied across ok
Modified: trunk/exp-ptrcheck/tests/strlen.c
===================================================================
--- trunk/exp-ptrcheck/tests/strlen.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/strlen.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -13,7 +13,7 @@
char* h = "hello, world";
char* p = strdup(h);
char u[20];
- char* c;
+ char* c __attribute__((unused));
int len;
len = strlen(p);
Modified: trunk/exp-ptrcheck/tests/unaligned.c
===================================================================
--- trunk/exp-ptrcheck/tests/unaligned.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/unaligned.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -6,7 +6,7 @@
int main ( void )
{
char* x = strdup("hello");
- char c;
+ char c __attribute__((unused));
char c0[8], c1[8], c2[8], c3[8], c4[8];
// Each of these pointers has a different alignment
Modified: trunk/exp-ptrcheck/tests/zero.c
===================================================================
--- trunk/exp-ptrcheck/tests/zero.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/exp-ptrcheck/tests/zero.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -5,7 +5,7 @@
int main ( void )
{
- char c, *c0 = malloc(0), *c1;
+ char c __attribute__((unused)), *c0 = malloc(0), *c1;
c = *c0; // bad
Modified: trunk/helgrind/helgrind.h
===================================================================
--- trunk/helgrind/helgrind.h 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/helgrind/helgrind.h 2011-04-03 17:42:19 UTC (rev 11682)
@@ -144,7 +144,7 @@
#define DO_CREQ_v_W(_creqF, _ty1F,_arg1F) \
do { \
- long int _unused_res, _arg1; \
+ long _unused_res __attribute__((unused)), _arg1; \
/* assert(sizeof(_ty1F) == sizeof(long int)); */ \
_arg1 = (long int)(_arg1F); \
VALGRIND_DO_CLIENT_REQUEST(_unused_res, 0, \
@@ -165,7 +165,8 @@
#define DO_CREQ_v_WW(_creqF, _ty1F,_arg1F, _ty2F,_arg2F) \
do { \
- long int _unused_res, _arg1, _arg2; \
+ long _unused_res __attribute__((unused)); \
+ long _arg1, _arg2; \
/* assert(sizeof(_ty1F) == sizeof(long int)); */ \
/* assert(sizeof(_ty2F) == sizeof(long int)); */ \
_arg1 = (long int)(_arg1F); \
@@ -178,7 +179,8 @@
#define DO_CREQ_v_WWW(_creqF, _ty1F,_arg1F, \
_ty2F,_arg2F, _ty3F, _arg3F) \
do { \
- long int _unused_res, _arg1, _arg2, _arg3; \
+ long _unused_res __attribute__((unused)); \
+ long _arg1, _arg2, _arg3; \
/* assert(sizeof(_ty1F) == sizeof(long int)); */ \
/* assert(sizeof(_ty2F) == sizeof(long int)); */ \
/* assert(sizeof(_ty3F) == sizeof(long int)); */ \
Modified: trunk/helgrind/tests/tc18_semabuse.c
===================================================================
--- trunk/helgrind/tests/tc18_semabuse.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/helgrind/tests/tc18_semabuse.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -16,7 +16,7 @@
void start_watchdog ( void );
int main ( void )
{
- int r;
+ int r __attribute__((unused));
sem_t s1;
start_watchdog();
/* Do sem_init with huge initial count */
Modified: trunk/massif/tests/realloc.c
===================================================================
--- trunk/massif/tests/realloc.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/massif/tests/realloc.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -3,7 +3,7 @@
int main(void)
{ // All sizes are multiples of 16 -- no slop.
int* x = realloc(NULL, 800); // equivalent to malloc(800), and ends up
- int* y; // calling Valgrind's (and Massif's) malloc
+ int* y __attribute__((unused)); // calling Valgrind's (and Massif's) malloc
x = realloc(x, 800); // same size
Modified: trunk/memcheck/tests/error_counts.c
===================================================================
--- trunk/memcheck/tests/error_counts.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/error_counts.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -8,9 +8,9 @@
{
int x;
int y = 0;
- int* reachable;
+ int* reachable __attribute__((unused));
int* dubious;
- int* leaked;
+ int* leaked __attribute__((unused));
DECLARE_LEAK_COUNTERS;
/* we require these longs to have same size as a machine word */
Modified: trunk/memcheck/tests/linux/brk.c
===================================================================
--- trunk/memcheck/tests/linux/brk.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/linux/brk.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -12,7 +12,7 @@
void* orig_ds = sbrk(0);
void* ds = orig_ds;
void* vals[10];
- void* res;
+ void* res __attribute__((unused));
#define EOL ((void*)( ~(long)0 ))
vals[0] = (void*)0;
vals[1] = (void*)1;
Modified: trunk/memcheck/tests/linux/stack_switch.c
===================================================================
--- trunk/memcheck/tests/linux/stack_switch.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/linux/stack_switch.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -32,7 +32,7 @@
int main(int argc, char **argv)
{
void *stack;
- int stackid;
+ int stackid __attribute__((unused));
pid_t pid;
/* "2*" is a ppc64-linux hack */
Modified: trunk/memcheck/tests/strchr.c
===================================================================
--- trunk/memcheck/tests/strchr.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/strchr.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -7,7 +7,7 @@
int main(int argc, char* argv[])
{
- char *s, *a, *b;
+ char *s, *a __attribute__((unused)), *b __attribute__((unused));
s = malloc(sizeof(char));
// Nb: s[0] is uninitialised, but almost certainly a zero
Modified: trunk/memcheck/tests/trivialleak.c
===================================================================
--- trunk/memcheck/tests/trivialleak.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/trivialleak.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -2,7 +2,7 @@
static void test()
{
- void* leak;
+ void* leak __attribute__((unused));
int i;
for (i = 0; i < 1000; i++)
leak = (void*)malloc( 1 );
Modified: trunk/memcheck/tests/x86-linux/scalar_exit_group.c
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar_exit_group.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/x86-linux/scalar_exit_group.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -5,7 +5,7 @@
// uninitialised, but we know px[0] is 0x0
long* px = malloc(sizeof(long));
long x0 = px[0];
- int res;
+ int res __attribute__((unused));
// All __NR_xxx numbers are taken from x86
Modified: trunk/memcheck/tests/x86-linux/scalar_fork.c
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar_fork.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/x86-linux/scalar_fork.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -2,7 +2,7 @@
int main(void)
{
- int res;
+ int res __attribute__((unused));
// All __NR_xxx numbers are taken from x86
Modified: trunk/memcheck/tests/x86-linux/scalar_vfork.c
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar_vfork.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/memcheck/tests/x86-linux/scalar_vfork.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -2,7 +2,7 @@
int main(void)
{
- int res;
+ int res __attribute__((unused));
// All __NR_xxx numbers are taken from x86
Modified: trunk/none/tests/bug129866.c
===================================================================
--- trunk/none/tests/bug129866.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/none/tests/bug129866.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -25,7 +25,7 @@
int main ( void )
{
- char *a1, *b1, *a2, *b2;
+ char *a1, *b1, *a2 __attribute__((unused)), *b2 __attribute__((unused));
printf("started\n");
a1 = touch_malloc(1600000) ;
b1 = touch_malloc(200000) ;
Modified: trunk/none/tests/coolo_sigaction.cpp
===================================================================
--- trunk/none/tests/coolo_sigaction.cpp 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/none/tests/coolo_sigaction.cpp 2011-04-03 17:42:19 UTC (rev 11682)
@@ -42,12 +42,11 @@
{
int i;
char buffer[200];
- size_t dummy_size_t;
setupHandlers();
FILE *p = popen("echo Hallo World", "r");
while (!feof(p)) {
int n = fread(buffer, 200, 1, p);
- dummy_size_t = write(2, buffer, n);
+ write(2, buffer, n);
}
fclose(p);
for (i = 0; i < 1000000; i++) ;
Modified: trunk/none/tests/linux/mremap2.c
===================================================================
--- trunk/none/tests/linux/mremap2.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/none/tests/linux/mremap2.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -74,7 +74,7 @@
/* show the working area */
void show ( void )
{
- int i,r;
+ int i,r __attribute__((unused));
for (i = 0; i < 200; i++) {
r = mprotect( workingarea + i * PAGE, PAGE, PROT_NONE );
// We used to print 'X' or '.' according to the mprotect result, but the
Modified: trunk/none/tests/x86/aad_aam.c
===================================================================
--- trunk/none/tests/x86/aad_aam.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/none/tests/x86/aad_aam.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -18,7 +18,8 @@
printf("test begins\n");
unsigned short i,out;
unsigned int flags;
- int cf,pf,af,zf,sf,of;
+ int cf __attribute__((unused)),pf,af __attribute__((unused)),zf,sf;
+ int of __attribute__((unused));
/* test AAM */
Modified: trunk/perf/sarp.c
===================================================================
--- trunk/perf/sarp.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/perf/sarp.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -31,7 +31,7 @@
{
int i, sum = 0;
- struct timespec req;
+ struct timespec req __attribute__((unused));
req.tv_sec = 0;
req.tv_nsec = 100*1000*1000; // 0.1s
Modified: trunk/perf/tinycc.c
===================================================================
--- trunk/perf/tinycc.c 2011-04-03 16:46:01 UTC (rev 11681)
+++ trunk/perf/tinycc.c 2011-04-03 17:42:19 UTC (rev 11682)
@@ -17975,7 +17975,8 @@
{
CString astr, astr1;
ASMOperand operands[MAX_ASM_OPERANDS];
- int nb_inputs, nb_outputs, nb_operands, i, must_subst, out_reg;
+ int nb_inputs __attribute__((unused));
+ int nb_outputs, nb_operands, i, must_subst, out_reg;
uint8_t clobber_regs[NB_ASM_REGS];
next();
@@ -18916,7 +18917,7 @@
/* build GOT and PLT entries */
static void build_got_entries(TCCState *s1)
{
- Section *s, *symtab;
+ Section *s, *symtab __attribute__((unused));
Elf32_Rel *rel, *rel_end;
Elf32_Sym *sym;
int i, type, reloc_type, sym_index;
@@ -20590,7 +20591,7 @@
static int rt_get_caller_pc(unsigned long *paddr,
ucontext_t *uc, int level)
{
- unsigned long fp;
+ unsigned long fp __attribute__((unused));
//int i;
if (level == 0) {
@@ -20757,7 +20758,7 @@
{
const char *p, *r;
TCCState *s;
- TokenSym *ts;
+ TokenSym *ts __attribute__((unused));
int i, c;
s = tcc_mallocz(sizeof(TCCState));
|