summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorKarel Zak2011-02-09 20:37:08 +0100
committerKarel Zak2011-02-09 20:40:06 +0100
commitc25dc28dff295ac707a0e8f3ed5a1f7c8b335910 (patch)
tree5edede7f4c0f0e76387dc9f231b0c21298c8e34e /include/c.h
parenttests: fix libmount test (diff)
downloadkernel-qcow2-util-linux-c25dc28dff295ac707a0e8f3ed5a1f7c8b335910.tar.gz
kernel-qcow2-util-linux-c25dc28dff295ac707a0e8f3ed5a1f7c8b335910.tar.xz
kernel-qcow2-util-linux-c25dc28dff295ac707a0e8f3ed5a1f7c8b335910.zip
include: [c.h]: add unused attribute to ignore_result()
unfortunately, gcc 4.6 void fn (void) { int foo; foo = bar (); } evaluates that foo is never used. The __attribute__((unused)) is necessary... Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/c.h b/include/c.h
index 4bb288758..e52514345 100644
--- a/include/c.h
+++ b/include/c.h
@@ -25,7 +25,9 @@
# define __must_be_array(a) \
BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
-# define ignore_result(x) ({ typeof(x) __dummy = (x); (void) __dummy; })
+# define ignore_result(x) ({ \
+ typeof(x) __dummy __attribute__((__unused__)) = (x); (void) __dummy; \
+})
#else /* !__GNUC__ */
# define __must_be_array(a) 0