From: Lai Jiangshan Date: Fri, 2 Dec 2011 13:05:08 +0000 (-0500) Subject: disable warning when -DNDEBUG(disable assert()) X-Git-Tag: v0.7.0~43^2~28 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ae843a6421259c05d3c9f7d70cd0dd098c1b4f55;p=userspace-rcu.git disable warning when -DNDEBUG(disable assert()) Signed-off-by: Lai Jiangshan Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash-mm-mmap.c b/rculfhash-mm-mmap.c index e2c565e..dba4524 100644 --- a/rculfhash-mm-mmap.c +++ b/rculfhash-mm-mmap.c @@ -36,14 +36,18 @@ static void *memory_map(size_t length) static void memory_unmap(void *ptr, size_t length) { - int ret = munmap(ptr, length); + int ret __attribute__((unused)); + + ret = munmap(ptr, length); assert(ret == 0); } static void memory_populate(void *ptr, size_t length) { - void *ret = mmap(ptr, length, PROT_READ | PROT_WRITE, + void *ret __attribute__((unused)); + + ret = mmap(ptr, length, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); assert(ret == ptr); @@ -55,7 +59,9 @@ static void memory_populate(void *ptr, size_t length) */ static void memory_discard(void *ptr, size_t length) { - void *ret = mmap(ptr, length, PROT_NONE, + void *ret __attribute__((unused)); + + ret = mmap(ptr, length, PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); assert(ret == ptr);