[lttng-dev] [PATCH 2/6] disable warning when -DNDEBUG(disable assert())

Lai Jiangshan laijs at cn.fujitsu.com
Fri Dec 2 05:07:34 EST 2011


Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 rculfhash-mm-mmap.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

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);
-- 
1.7.4.4




More information about the lttng-dev mailing list