From: Julian Seward Date: Thu, 6 Dec 2012 23:11:19 +0000 (+0000) Subject: Fix some gcc complaints about unused variables in these tests. X-Git-Tag: svn/VALGRIND_3_9_0~505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a820fcbf4740740d46a591f4a1c1cecb1e6629;p=thirdparty%2Fvalgrind.git Fix some gcc complaints about unused variables in these tests. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13167 --- diff --git a/memcheck/tests/amd64/insn-bsfl.c b/memcheck/tests/amd64/insn-bsfl.c index 426c6c863f..0190069338 100644 --- a/memcheck/tests/amd64/insn-bsfl.c +++ b/memcheck/tests/amd64/insn-bsfl.c @@ -21,7 +21,7 @@ static int ctz(UInt x) "defined"; 1 means "undefined". */ static void set_vbits(UInt *addr, UInt vbits) { - VALGRIND_SET_VBITS(addr, &vbits, sizeof(unsigned)); + (void)VALGRIND_SET_VBITS(addr, &vbits, sizeof(unsigned)); } static void doit(unsigned vbits, unsigned val) diff --git a/memcheck/tests/amd64/insn-pcmpistri.c b/memcheck/tests/amd64/insn-pcmpistri.c index e0e11a0ba8..d6ae92cffb 100644 --- a/memcheck/tests/amd64/insn-pcmpistri.c +++ b/memcheck/tests/amd64/insn-pcmpistri.c @@ -51,12 +51,12 @@ int test_strlen(const char *const s, int valid) /* Mark all bytes beyond the null as invalid. */ size_t i; for (i=len ; i < roundup ; ++i) - VALGRIND_SET_VBITS(&s_copy[i], &ff, 1); + (void)VALGRIND_SET_VBITS(&s_copy[i], &ff, 1); } else { /* Mark the null byte itself as invalid. */ assert(len > 0); - VALGRIND_SET_VBITS(&s_copy[len-1], &ff, 1); + (void)VALGRIND_SET_VBITS(&s_copy[len-1], &ff, 1); } result = aligned_strlen(s_copy); diff --git a/memcheck/tests/amd64/insn-pmovmskb.c b/memcheck/tests/amd64/insn-pmovmskb.c index 176a59a15f..2f14e75813 100644 --- a/memcheck/tests/amd64/insn-pmovmskb.c +++ b/memcheck/tests/amd64/insn-pmovmskb.c @@ -25,7 +25,7 @@ static void set_vbits(V128 *addr, V128 vbits) { int i; for (i=0 ; i<2 ; ++i) { - VALGRIND_SET_VBITS(&addr->w64[i], &vbits.w64[i], sizeof(vbits.w64[i])); + (void)VALGRIND_SET_VBITS(&addr->w64[i], &vbits.w64[i], sizeof(vbits.w64[i])); } } diff --git a/memcheck/tests/linux/sys-openat.c b/memcheck/tests/linux/sys-openat.c index 31b626bbc0..cbb02f429f 100644 --- a/memcheck/tests/linux/sys-openat.c +++ b/memcheck/tests/linux/sys-openat.c @@ -9,11 +9,11 @@ int main (void) { int dfd = open ("/tmp", O_RDONLY); - int fd1 = openat (dfd, "abc", O_RDONLY); + __attribute__((unused)) int fd1 = openat (dfd, "abc", O_RDONLY); /* This is fine, absolute path. */ - int fd2 = openat (0x12345678, "/tmp/abc", O_RDONLY); - int fd3 = openat (AT_FDCWD, "abc", O_RDONLY); + __attribute__((unused)) int fd2 = openat (0x12345678, "/tmp/abc", O_RDONLY); + __attribute__((unused)) int fd3 = openat (AT_FDCWD, "abc", O_RDONLY); /* This is the only one that should warn. */ - int fd4 = openat (0x12345678, "abc", O_RDONLY); + __attribute__((unused)) int fd4 = openat (0x12345678, "abc", O_RDONLY); return 0; }