summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-07-05 17:16:23 +0200
committerJim Meyering <meyering@redhat.com>2010-07-05 17:39:46 +0200
commit61aae73f5427c987b20604fbec5772e02edc0f74 (patch)
treea68005fba98f2e345b93c5b13dd9b11df12ba541 /src/system.h
parent09fcf494a10c4b1ad2b037d093f571e7462e08c4 (diff)
downloadcoreutils-61aae73f5427c987b20604fbec5772e02edc0f74.tar.xz
system.h: define ATTRIBUTE_WARN_UNUSED_RESULT
* src/system.h (ATTRIBUTE_WARN_UNUSED_RESULT): Define.
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
index 859b663b9..9e1468172 100644
--- a/src/system.h
+++ b/src/system.h
@@ -483,6 +483,14 @@ enum
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
+/* The warn_unused_result attribute appeared first in gcc-3.4.0 */
+#undef ATTRIBUTE_WARN_UNUSED_RESULT
+#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+# define ATTRIBUTE_WARN_UNUSED_RESULT /* empty */
+#else
+# define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
+#endif
+
#if defined strdupa
# define ASSIGN_STRDUPA(DEST, S) \
do { DEST = strdupa (S); } while (0)