cast, container_of, tlist: Fix warning with GCC 4.6: -Wunused-but-set-variable
authorJoey Adams <joeyadams3.14159@gmail.com>
Sun, 29 May 2011 02:23:55 +0000 (22:23 -0400)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 May 2011 06:08:20 +0000 (15:38 +0930)
14 files changed:
ccan/cast/test/compile_fail-cast_const.c
ccan/cast/test/compile_fail-cast_const2.c
ccan/cast/test/compile_fail-cast_const3.c
ccan/cast/test/compile_fail-cast_signed-const.c
ccan/cast/test/compile_fail-cast_signed-sizesame.c
ccan/cast/test/compile_fail-cast_signed.c
ccan/cast/test/compile_fail-cast_static-2.c
ccan/cast/test/compile_fail-cast_static-3.c
ccan/cast/test/compile_fail-cast_static.c
ccan/container_of/test/compile_fail-types.c
ccan/container_of/test/compile_fail-var-types.c
ccan/tlist/test/compile_fail-tlist_for_each.c
ccan/tlist/test/compile_fail-tlist_tail.c
ccan/tlist/test/compile_fail-tlist_top.c

index d401cc8ca91c488c159fb8f0d0bdb63bb0fd9df4..277f3de1c442b21fd9a8953b560a97d5bbb80e58 100644 (file)
@@ -18,6 +18,7 @@ int main(int argc, char *argv[])
                *p = NULL;
 
        uc = cast_const(char *, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index a16cfacf15354c468189d50a4a87d6550da30442..e671e88eda56ca3dfdfab58bf3cd299fe4627e86 100644 (file)
@@ -18,6 +18,7 @@ int main(int argc, char *argv[])
                **p = NULL;
 
        uc = cast_const2(char **, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index f782f9d9ec5d10fc317021179934b17057ae60e0..e958e2dde5b61c485f63be5008c3ac5137733ecc 100644 (file)
@@ -18,6 +18,7 @@ int main(int argc, char *argv[])
                ***p = NULL;
 
        uc = cast_const3(char ***, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index 791d9b84529aa4bad527ec18294ff079a1b547bd..9971dc8eb320cbdc1fc3cfcde2c71b34ea51f6ad 100644 (file)
@@ -11,6 +11,7 @@ int main(int argc, char *argv[])
                *p = NULL;
 
        uc = cast_signed(unsigned char *, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index 87da721647bea6ef3d40068cb5c124a41126c660..2bc40b2f462b0ece7254eb671ed8c80f6167816a 100644 (file)
@@ -18,6 +18,7 @@ int main(int argc, char *argv[])
 
        uc = cast_signed(unsigned char *, p);
 
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index 5b182ab5ba70dcbc08e99c4ec043af7b69bedce6..66bcc0a1b5ef6f6bed57d9870d81ce00cebb5b50 100644 (file)
@@ -12,5 +12,6 @@ int main(int argc, char *argv[])
                *p = NULL;
 
        uc = cast_signed(unsigned char *, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
index d3ba8d3ed602b8c97629eb968a507e3039f16a67..8a1202538455ecc4a30b96bd352f843e1d6c07d3 100644 (file)
@@ -12,6 +12,7 @@ int main(int argc, char *argv[])
                *p = 0;
 
        c = cast_static(char *, p);
+       (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index 1625f545f3c9e2a1eeb49e514690fde8f6de839b..6296b752769822d1880e72d5bf3570f82170bed4 100644 (file)
@@ -10,6 +10,7 @@ int main(int argc, char *argv[])
                char *p = 0;
 
        c = cast_static(char *, p);
+       (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
 
index 51ea8c2d7d92e6f4307a140e0fff1221a996b3ff..0f9e4780470a267dbf4573b76bd4791ba58f70b3 100644 (file)
@@ -12,5 +12,6 @@ int main(int argc, char *argv[])
                x = 0;
 
        c = cast_static(char, x);
+       (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
index a50b11c2b36b69e3dadd8766916a2eabb96f825a..cae1c7abd20a1ed36ae6072faa8b50d9aea2644e 100644 (file)
@@ -17,5 +17,6 @@ int main(int argc, char *argv[])
 #else
        foop = NULL;
 #endif
+       (void) foop; /* Suppress unused-but-set-variable warning. */
        return intp == NULL;
 }
index b7f395c761e7e91a327ef45bc86bec3d14454430..f254d9210207fabfd3eedc69062516b0ccafc64e 100644 (file)
@@ -20,5 +20,6 @@ int main(int argc, char *argv[])
 #else
        foop = NULL;
 #endif
+       (void) foop; /* Suppress unused-but-set-variable warning. */
        return intp == NULL;
 }
index e2a267b8f3c7392e2a6fb09e54098b1654235273..1b2fb6882fe9594bebd203086719fdaf69720ebe 100644 (file)
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
        tlist_init(&children);
        tlist_add(&children, &child, list);
 
-       tlist_for_each(&children, c, list);
+       tlist_for_each(&children, c, list)
+               (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
index ab43ae90d38ca7ac2312e26343d54358416659e8..0a9dabace7bad8462898fa794d496d8fa9d02da6 100644 (file)
@@ -31,5 +31,6 @@ int main(int argc, char *argv[])
                      struct child,
 #endif
                      list);
+       (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
index 622a5781532f583fd18e3645312327ad50950541..d02c3add7a2e0a4fb780527e63e433a519510d38 100644 (file)
@@ -31,5 +31,6 @@ int main(int argc, char *argv[])
                      struct child,
 #endif
                      list);
+       (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }