aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 3b6949b41745..498c35920762 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -108,15 +108,30 @@ extern void __chk_io_ptr(const void __iomem *);
108 * Allow us to avoid 'defined but not used' warnings on functions and data, 108 * Allow us to avoid 'defined but not used' warnings on functions and data,
109 * as well as force them to be emitted to the assembly file. 109 * as well as force them to be emitted to the assembly file.
110 * 110 *
111 * As of gcc 3.3, static functions that are not marked with attribute((used)) 111 * As of gcc 3.4, static functions that are not marked with attribute((used))
112 * may be elided from the assembly file. As of gcc 3.3, static data not so 112 * may be elided from the assembly file. As of gcc 3.4, static data not so
113 * marked will not be elided, but this may change in a future gcc version. 113 * marked will not be elided, but this may change in a future gcc version.
114 * 114 *
115 * NOTE: Because distributions shipped with a backported unit-at-a-time
116 * compiler in gcc 3.3, we must define __used to be __attribute__((used))
117 * for gcc >=3.3 instead of 3.4.
118 *
115 * In prior versions of gcc, such functions and data would be emitted, but 119 * In prior versions of gcc, such functions and data would be emitted, but
116 * would be warned about except with attribute((unused)). 120 * would be warned about except with attribute((unused)).
121 *
122 * Mark functions that are referenced only in inline assembly as __used so
123 * the code is emitted even though it appears to be unreferenced.
117 */ 124 */
118#ifndef __attribute_used__ 125#ifndef __attribute_used__
119# define __attribute_used__ /* unimplemented */ 126# define __attribute_used__ /* deprecated */
127#endif
128
129#ifndef __used
130# define __used /* unimplemented */
131#endif
132
133#ifndef __maybe_unused
134# define __maybe_unused /* unimplemented */
120#endif 135#endif
121 136
122/* 137/*