From c252157489c5da21c0a7639d0f1e6f16f00e0989 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 19 Oct 2012 07:27:29 +0400 Subject: [PATCH] Specify GC_malloc result is unused in some tests * tests/middle.c (main): Explicitly cast result of GC_malloc[_atomic] to void (to outline that the result is unused intentionally). * tests/test.c (run_one_test): Likewise. --- tests/middle.c | 8 ++++---- tests/test.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/middle.c b/tests/middle.c index ff0a2355..55686f75 100644 --- a/tests/middle.c +++ b/tests/middle.c @@ -13,12 +13,12 @@ int main (void) GC_INIT(); for (i = 0; i < 20000; ++i) { - GC_malloc_atomic (4096); - GC_malloc (4096); + (void)GC_malloc_atomic(4096); + (void)GC_malloc(4096); } for (i = 0; i < 20000; ++i) { - GC_malloc_atomic (2048); - GC_malloc (2048); + (void)GC_malloc_atomic(2048); + (void)GC_malloc(2048); } printf("Final heap size is %lu\n", (unsigned long)GC_get_heap_size()); return 0; diff --git a/tests/test.c b/tests/test.c index e4d6af40..0cb1d569 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1201,7 +1201,7 @@ void run_one_test(void) { size_t i; - GC_malloc(17); + (void)GC_malloc(17); for (i = sizeof(GC_word); i < 512; i *= 2) { GC_word result = (GC_word) GC_memalign(i, 17); if (result % i != 0 || result == 0 || *(int *)result != 0) FAIL; @@ -1234,9 +1234,9 @@ void run_one_test(void) { size_t i; for (i = 0; i < 10000; ++i) { - GC_MALLOC(0); + (void)GC_MALLOC(0); GC_FREE(GC_MALLOC(0)); - GC_MALLOC_ATOMIC(0); + (void)GC_MALLOC_ATOMIC(0); GC_FREE(GC_MALLOC_ATOMIC(0)); } } -- 2.40.0