|
From: <sv...@va...> - 2012-12-06 23:11:30
|
sewardj 2012-12-06 23:11:19 +0000 (Thu, 06 Dec 2012)
New Revision: 13167
Log:
Fix some gcc complaints about unused variables in these tests.
Modified files:
trunk/memcheck/tests/amd64/insn-bsfl.c
trunk/memcheck/tests/amd64/insn-pcmpistri.c
trunk/memcheck/tests/amd64/insn-pmovmskb.c
trunk/memcheck/tests/linux/sys-openat.c
Modified: trunk/memcheck/tests/amd64/insn-pmovmskb.c (+1 -1)
===================================================================
--- trunk/memcheck/tests/amd64/insn-pmovmskb.c 2012-12-06 22:41:47 +00:00 (rev 13166)
+++ trunk/memcheck/tests/amd64/insn-pmovmskb.c 2012-12-06 23:11:19 +00:00 (rev 13167)
@@ -25,7 +25,7 @@
{
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]));
}
}
Modified: trunk/memcheck/tests/amd64/insn-pcmpistri.c (+2 -2)
===================================================================
--- trunk/memcheck/tests/amd64/insn-pcmpistri.c 2012-12-06 22:41:47 +00:00 (rev 13166)
+++ trunk/memcheck/tests/amd64/insn-pcmpistri.c 2012-12-06 23:11:19 +00:00 (rev 13167)
@@ -51,12 +51,12 @@
/* 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);
Modified: trunk/memcheck/tests/amd64/insn-bsfl.c (+1 -1)
===================================================================
--- trunk/memcheck/tests/amd64/insn-bsfl.c 2012-12-06 22:41:47 +00:00 (rev 13166)
+++ trunk/memcheck/tests/amd64/insn-bsfl.c 2012-12-06 23:11:19 +00:00 (rev 13167)
@@ -21,7 +21,7 @@
"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)
Modified: trunk/memcheck/tests/linux/sys-openat.c (+4 -4)
===================================================================
--- trunk/memcheck/tests/linux/sys-openat.c 2012-12-06 22:41:47 +00:00 (rev 13166)
+++ trunk/memcheck/tests/linux/sys-openat.c 2012-12-06 23:11:19 +00:00 (rev 13167)
@@ -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;
}
|