]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11682
authorBart Van Assche <bvanassche@acm.org>
Sun, 3 Apr 2011 17:42:19 +0000 (17:42 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 3 Apr 2011 17:42:19 +0000 (17:42 +0000)
32 files changed:
drd/tests/annotate_ignore_rw.c
drd/tests/custom_alloc.c
drd/tests/sigalrm.c
drd/tests/tsan_unittest.cpp
exp-ptrcheck/tests/arith_include2.c
exp-ptrcheck/tests/hp_bounds.c
exp-ptrcheck/tests/hp_dangle.c
exp-ptrcheck/tests/justify.c
exp-ptrcheck/tests/mm.c
exp-ptrcheck/tests/partial.c
exp-ptrcheck/tests/pth_specific.c
exp-ptrcheck/tests/realloc.c
exp-ptrcheck/tests/strlen.c
exp-ptrcheck/tests/unaligned.c
exp-ptrcheck/tests/zero.c
helgrind/helgrind.h
helgrind/tests/tc18_semabuse.c
massif/tests/realloc.c
memcheck/tests/error_counts.c
memcheck/tests/linux/brk.c
memcheck/tests/linux/stack_switch.c
memcheck/tests/strchr.c
memcheck/tests/trivialleak.c
memcheck/tests/x86-linux/scalar_exit_group.c
memcheck/tests/x86-linux/scalar_fork.c
memcheck/tests/x86-linux/scalar_vfork.c
none/tests/bug129866.c
none/tests/coolo_sigaction.cpp
none/tests/linux/mremap2.c
none/tests/x86/aad_aam.c
perf/sarp.c
perf/tinycc.c

index f6a63b6583a6148a05a95cc665dd00fce1adc482..75e9f98df1fd93517b0fd909023fe6f7ed247ceb 100644 (file)
@@ -24,7 +24,6 @@ int main(int argc, char** argv)
 {
   int optchar;
   int ign_rw = 1;
-  int tmp;
   pthread_t tid;
 
   while ((optchar = getopt(argc, argv, "r")) != EOF)
@@ -54,7 +53,7 @@ int main(int argc, char** argv)
   sleep(1);
 
   /* Read s_c. */
-  tmp = s_c;
+  fprintf(stderr, "x" + s_c);
 
   pthread_join(tid, 0);
 
index 9faead5692e2832db870cddde5dceace327c9525..858155ef8b907c2ba3f7158e392036d40789f3bc 100644 (file)
@@ -57,7 +57,7 @@ static void custom_free(void* p)
 
 void make_leak(void)
 {
-   int* array2 = custom_alloc(sizeof(int) * 10);
+   int* array2 __attribute__((unused)) = custom_alloc(sizeof(int) * 10);
    array2 = 0;          // leak
    return;
 }
index 408eaf8cbcb0fefc2016d09d7947ec9594d4bf52..38b979c560ca0f0270a266ebaf779eec1bd84a80 100644 (file)
@@ -55,7 +55,6 @@ void* thread_func(void* thread_arg)
 
 int main(int argc, char** argv)
 {
-  int vgthreadid;
   pthread_t threadid;
   struct timespec tsDelay;
 
@@ -63,8 +62,6 @@ int main(int argc, char** argv)
   if (argc > 1)
     s_debug = 1;
 
-  vgthreadid = DRD_GET_VALGRIND_THREADID;
-
   print_thread_id("main: ");
 
   {
index 57357a3371cd6378d158ee062eecc6a01f9b3014..431a62280c4edb08fa1f33508de7849dcd909836 100644 (file)
@@ -3469,7 +3469,7 @@ void Worker() {
   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 @@ namespace test105 {
 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 F1() {
 }
 
 void Worker() {
-  int ar[32];
+  int ar[32] __attribute__((unused));
 //  ANNOTATE_TRACE_MEMORY(&ar[0]);
 //  ANNOTATE_TRACE_MEMORY(&ar[31]);
   ar[0] = 1;
index 2cc7e41cb0aa142882e8239d3aab57f7e01299e6..524ca997f54a1c23afe0a1d7415a30e2189ed275 100644 (file)
@@ -15,7 +15,7 @@
 
    struct sigaction sigsegv;
    // Scratch values
-   long  a, tn;
+   long  a, tn __attribute__((unused));
    long* tp;
    
    // Known pointers
index c285e535ad98139f1d9cf075f01820c05d023024..e456cabe8ee2ba0460b610e377164216f1bed275 100644 (file)
@@ -2,7 +2,7 @@
 
 int main(void)
 {
-   int  y;
+   int  y __attribute__((unused));
    int* x = malloc(sizeof(int) * 100);
 
    y = x[95];   // ok
index 271e0ef6011a5314c6598fc05ee08a66fbb49f68..31470df42f3882af6c30bc7395bbcee02d156cb7 100644 (file)
@@ -11,7 +11,7 @@ int* mk_dangle(void)
 
 int main(void)
 {
-   int  y;
+   int  y __attribute__((unused));
    int* x = mk_dangle();
 
    y = x[5];
index 0cc5295a08291815427dd0b8c5d8d54ae60394f6..366c78ba36fea253c3e00dfab8d8aff5af668b1d 100644 (file)
@@ -10,7 +10,7 @@
 
 int main ( void )
 {
-   char c;
+   char c __attribute__((unused));
    char *c0, *c1;
 
    c0 = malloc(10000);
index 0f1a9bd241a1eac88190bb8aefc82e84916d44ff..0d78cf36af12e97c61a6af94debfcd8b80c21bd0 100644 (file)
@@ -15,7 +15,7 @@ int main(void)
 {
    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).
index 7bdc356482684e79300bad1aafbee8e03ceba437..2b2ee7fd3dfaa5a5befe51d0fa4bce9ce3eefbf6 100644 (file)
@@ -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);
index d679bb79afb0bff5b73d1c27924c6c5f27618152..9b8ca919d2ffe39c13c72d63cdb19c2274531d2e 100644 (file)
@@ -12,7 +12,7 @@ int main(void)
 {
    pthread_key_t key;
    char *x, *z;
-   char  y;
+   char  y __attribute__((unused));
 
    x = malloc(100);
 
index f588d536bb100bc7a452074d838c0983fe13f339..8884664eb2572928f95556e9804b348b0d7dd005 100644 (file)
@@ -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
    
index 92b5c148a40db0c031a1a98f71a1c4da5fdecdfb..92abf4611356528e8ad8f25157aac9c77e413456 100644 (file)
@@ -13,7 +13,7 @@ int main(void)
    char* h  = "hello, world";
    char* p = strdup(h);
    char  u[20];
-   char* c;
+   char* c __attribute__((unused));
    int   len;
 
    len = strlen(p);
index 181e9176e11a3b617656ad03c22f062bcb4b8f24..6c7ba39d04c008de126520951dd67c48c7fc29f3 100644 (file)
@@ -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
index adea4d6a1d4b28822cf3ac9b59b1faacae5ccba2..7077bb4462f0b1c2ad7777c26912365ae0ef9f25 100644 (file)
@@ -5,7 +5,7 @@
 
 int main ( void )
 {
-   char c, *c0 = malloc(0), *c1;
+   char c __attribute__((unused)), *c0 = malloc(0), *c1;
 
    c = *c0;    // bad
 
index cbe09002eb7968e2c3916b7dad1c4e5d5ad66559..64271eddbb14483d05fdf365589ce461255e4c35 100644 (file)
@@ -144,7 +144,7 @@ typedef
 
 #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 @@ typedef
 
 #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 @@ typedef
 #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)); */   \
index 40c068bdea24e7dd5a1b7eefbe0d72b69fb9a270..7395251ed820b1a6d110c242c21d8723f0a0e071 100644 (file)
@@ -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 */
index 9c772761b4a8b9d618457cf9f2c73376dfcc9b22..f6a37f86700469b11c7b54a0b7787de99df9650d 100644 (file)
@@ -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
 
index 5268cdbc0de22713536d7d0869c1c22a4d8266bd..271dc9a4385778a9f29cb69411c410408cea8905 100644 (file)
@@ -8,9 +8,9 @@ int main(void)
 {
    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 */
index 21bf84ec636fe090f35e0b2aad9ee341e57bfb65..5ca054f866a68245756d91f71696acd9f86c24f5 100644 (file)
@@ -12,7 +12,7 @@ int main(void)
    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;
index 1d179351dcafcc9a5a845691edb5c28436629ac6..d54870dc79954960861874bdd674dba4590e3e81 100644 (file)
@@ -32,7 +32,7 @@ static int thread_main(void *arg)
 int main(int argc, char **argv)
 {
    void *stack;
-   int stackid;
+   int stackid __attribute__((unused));
    pid_t pid;
 
    /* "2*" is a ppc64-linux hack */
index 01aaef9d367e6fb8d3151bb44cac3739f23a2a9c..2c77f0903e78dd42554fdbb739f7975c710dc07c 100644 (file)
@@ -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
index f3a8963359c52326d5ed5126c909d962abc11f04..7ffcb8735c9848ffe3844a10a99189901d6638f6 100644 (file)
@@ -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 );
index 214d6c3df41819648121ddd00827be1bfc91dcce..f843988b215ae7705f27bf9ca4865cdd542e4b6b 100644 (file)
@@ -5,7 +5,7 @@ int main(void)
    // 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
    
index 805ade844c616928e8e404f66bd42b89c38d6cbc..914fdfbdb29bd910a64c794eb26403d985fbab57 100644 (file)
@@ -2,7 +2,7 @@
 
 int main(void)
 {
-   int res;
+   int res __attribute__((unused));
    
    // All __NR_xxx numbers are taken from x86
    
index fe999fb9231a90fdedfea66d17ee2597ac484b18..984c22eddeebfc4b6e59aaa2bf89dfb26fc7e64a 100644 (file)
@@ -2,7 +2,7 @@
 
 int main(void)
 {
-   int res;
+   int res __attribute__((unused));
    
    // All __NR_xxx numbers are taken from x86
    
index abb8b2f0eed674a60dc34a0f11133456e3e5a870..da13aca87baca7c78ffd018d46442775c808377f 100644 (file)
@@ -25,7 +25,7 @@ char * touch_realloc (char * ptr, int size)
 
 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) ;
index 2481746465f8dcdd630e0e384d756a5e5bb4cfcc..02aacd268fd4399da80e1f7909e0bf7d9a9caecc 100644 (file)
@@ -42,12 +42,11 @@ int main()
 {
     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++) ;
index 76c28262417d4221fd0efa976896a29acf4f9002..b8ad0682108035f0502bfa518d9508a6f38eb48d 100644 (file)
@@ -74,7 +74,7 @@ char* setup ( void* other_stuff, int other_len )
 /* 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
index 342044ac3e9d3901d7c5406f80aab0b063e06859..f81140b09324929a56bcfd64261b9f3334da6a0e 100644 (file)
@@ -18,7 +18,8 @@ int main(int argc, char **argv) {
   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 */
 
index 6265ad7245e8f280b4c64410557368d66c640e2d..ffb808d241a047366145b7dd5040285007bc95ce 100644 (file)
@@ -31,7 +31,7 @@ int main(void)
 {
    int i, sum = 0;
 
-   struct timespec req;
+   struct timespec req __attribute__((unused));
    req.tv_sec  = 0;
    req.tv_nsec = 100*1000*1000;   // 0.1s
 
index 51da47a859e9754a127a9c3a3a287d180034586e..42ff75fc5c72319cdcb834c18e9e3639be037873 100644 (file)
@@ -17975,7 +17975,8 @@ static void asm_instr(void)
 {
     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 @@ static void put_got_entry(TCCState *s1,
 /* 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 void rt_printline(unsigned long wanted_pc)
 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 @@ TCCState *tcc_new(void)
 {
     const char *p, *r;
     TCCState *s;
-    TokenSym *ts;
+    TokenSym *ts __attribute__((unused));
     int i, c;
 
     s = tcc_mallocz(sizeof(TCCState));