From 5e9c4ec97324f27b1b23cd118325f4cfa1db6d73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 14 Apr 2014 21:53:40 +0200 Subject: [PATCH] orcarray: Fix compiler warning with gcc 4.9 In file included from ../orc/orcprogram.h:5:0, from ../orc/orc.h:5, from ../orc-test/orctest.h:5, from orcarray.c:6: ../orc/orcutils.h:124:37: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized] #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) ^ orcarray.c:42:9: note: 'data' was declared here void *data; --- orc-test/orcarray.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orc-test/orcarray.c b/orc-test/orcarray.c index 9860204..089b0d1 100644 --- a/orc-test/orcarray.c +++ b/orc-test/orcarray.c @@ -42,7 +42,7 @@ orc_array_new (int n, int m, int element_size, int misalignment, void *data; #ifndef USE_MMAP #ifdef HAVE_POSIX_MEMALIGN - int ret ORC_GNUC_UNUSED; + int ret; #endif #endif int offset; @@ -71,6 +71,7 @@ orc_array_new (int n, int m, int element_size, int misalignment, #else #ifdef HAVE_POSIX_MEMALIGN ret = posix_memalign (&data, ALIGNMENT, ar->alloc_len); + ORC_ASSERT (ret == 0); ar->alloc_data = data; ar->aligned_data = data; #else -- 2.7.4