]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/test/run-testsize.c
Remove compile warnings of tests under Ubuntu (return value ignored)
[ccan] / ccan / alloc / test / run-testsize.c
index bb063c24cfa4ea228dec8ff1531b01642316982f..9071cb6d348951c44b5656d442751a32aa7aa839 100644 (file)
@@ -3,6 +3,7 @@
 #include "alloc/alloc.c"
 #include <stdlib.h>
 #include <stdbool.h>
+#include <err.h>
 
 #define POOL_ORD 16
 #define POOL_SIZE (1 << POOL_ORD)
@@ -34,7 +35,8 @@ int main(int argc, char *argv[])
        plan_tests(5);
 
        /* FIXME: Needs to be page aligned for now. */
-       posix_memalign(&mem, 1 << POOL_ORD, POOL_SIZE);
+       if (posix_memalign(&mem, 1 << POOL_ORD, POOL_SIZE) != 0)
+               errx(1, "Failed allocating aligned memory"); 
 
        alloc_init(mem, POOL_SIZE);