From 12a820fcbf4740740d46a591f4a1c1cecb1e6629 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Thu, 6 Dec 2012 23:11:19 +0000 Subject: [PATCH] Fix some gcc complaints about unused variables in these tests. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13167 --- memcheck/tests/amd64/insn-bsfl.c | 2 +- memcheck/tests/amd64/insn-pcmpistri.c | 4 ++-- memcheck/tests/amd64/insn-pmovmskb.c | 2 +- memcheck/tests/linux/sys-openat.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/memcheck/tests/amd64/insn-bsfl.c b/memcheck/tests/amd64/insn-bsfl.c index 426c6c863..019006933 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 e0e11a0ba..d6ae92cff 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 176a59a15..2f14e7581 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 31b626bbc..cbb02f429 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; }