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
++)
30 printf("sum is positive\n");
32 printf("sum is non-positive\n");
34 m
= VALGRIND_DISCARD(m
);
35 printf("m_rm: returned value is %d\n", m
);
37 for (i
= 0; i
< 100; i
++)
40 printf("sum is positive\n");
42 printf("sum is non-positive\n");