Julian Seward 084b7cb10b Fix #284384 (clang 3.1 -Wunused-value warnings in valgrind.h,
memcheck.h) by changing a bunch of VALGRIND_DO_CLIENT_REQUEST_EXPR
into VALGRIND_DO_CLIENT_REQUEST_STMT for cases where the return value
of the former would be unused.  (Bart Van Assche, bart.vanassche@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12226
2011-10-24 13:21:57 +00:00

31 lines
448 B
C

#include <stdio.h>
#include "../../include/valgrind.h"
int fooble ( void )
{
int x, y;
y = 0;
for (x = 0; x < 100; x++) {
if ((x % 3) == 0) y += x; else y++;
}
return y;
}
void someother ( void )
{
}
int main ( void )
{
printf("fooble-1() = %d\n", fooble() );
VALGRIND_DISCARD_TRANSLATIONS( (char*)(&fooble),
((char*)(&someother)) - ((char*)(&fooble)) );
printf("fooble-2() = %d\n", fooble() );
return 0;
}