summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRichard Henderson <rth@kanga.twiddle.net>2003-02-18 19:34:11 -0800
committerRichard Henderson <rth@kanga.twiddle.net>2003-02-18 19:34:11 -0800
commit612cbdcf44289e81a4327d8f67fcc41e07ad33c3 (patch)
treeff8ba2822a74a5b80ab3dc6f63f4387320f370a4 /include/linux
parent94fd582e6af0fe11e3fa39b731c182b6bb4055f8 (diff)
parent0dd22e544a9aa65979a92d0c7d5186163d2d7beb (diff)
Merge kanga.twiddle.net:/home/rth/linux/linus-2.5
into kanga.twiddle.net:/home/rth/linux/axp-2.5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 70ed5ef37a4c..e92f4723c1e2 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -25,6 +25,23 @@
#define __deprecated
#endif
+/*
+ * Allow us to avoid 'defined but not used' warnings on functions and data,
+ * as well as force them to be emitted to the assembly file.
+ *
+ * As of gcc 3.3, static functions that are not marked with attribute((used))
+ * may be elided from the assembly file. As of gcc 3.3, static data not so
+ * marked will not be elided, but this may change in a future gcc version.
+ *
+ * In prior versions of gcc, such functions and data would be emitted, but
+ * would be warned about except with attribute((unused)).
+ */
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || __GNUC__ > 3
+#define __attribute_used__ __attribute__((__used__))
+#else
+#define __attribute_used__ __attribute__((__unused__))
+#endif
+
/* This macro obfuscates arithmetic on a variable address so that gcc
shouldn't recognize the original var, and make assumptions about it */
#define RELOC_HIDE(ptr, off) \