Fix some gcc complaints about unused variables in these tests.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13167
This commit is contained in:
Julian Seward 2012-12-06 23:11:19 +00:00
parent 3e9eadf4b4
commit 12a820fcbf
4 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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]));
}
}

View File

@ -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;
}