5 #include "../memcheck.h"
10 for (i
= 0; i
< 10; i
++) (void) VALGRIND_CHECK_VALUE_IS_DEFINED(xxx
);
17 char* aa
= calloc(100,1);
20 (void) VALGRIND_CHECK_MEM_IS_DEFINED(aa
,100);
22 m
= VALGRIND_MAKE_MEM_UNDEFINED( &aa
[49], 1 );
23 (void) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(aa
,100);
25 printf("m_na: returned value is %d\n", m
);
27 for (i
= 0; i
< 100; i
++)
29 printf("sum is %s\n", sum
> 0 ? "positive" : "non-positive");
31 m
= VALGRIND_DISCARD(m
);
32 printf("m_rm: returned value is %d\n", m
);
34 for (i
= 0; i
< 100; i
++)
36 printf("sum is %s\n", sum
> 0 ? "positive" : "non-positive");