aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
authorMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-08-30 13:13:37 -0400
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-09-30 14:14:03 -0400
commit5c67a52f3da0f0d22764f2daec417702695a8112 (patch)
tree2d3921c950b927a3bdf1a54265fd76409804e0ed /include/linux/compiler-gcc.h
parent29efbc6aea9d9bd9aa9870a9afc1882046303cf9 (diff)
Compiler Attributes: always use the extra-underscores syntax
The attribute syntax optionally allows to surround attribute names with "__" in order to avoid collisions with macros of the same name (see https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html). This homogenizes all attributes to use the syntax with underscores. While there are currently only a handful of cases of some TUs defining macros like "error" which may collide with the attributes, this should prevent futures surprises. This has been done only for "standard" attributes supported by the major compilers. In other words, those of third-party tools (e.g. sparse, plugins...) have not been changed for the moment. Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # on top of v4.19-rc5, clang 7 Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r--include/linux/compiler-gcc.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 1302b425e625..7a1de7683df5 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -76,7 +76,7 @@
76#endif 76#endif
77 77
78#ifdef RETPOLINE 78#ifdef RETPOLINE
79#define __noretpoline __attribute__((indirect_branch("keep"))) 79#define __noretpoline __attribute__((__indirect_branch__("keep")))
80#endif 80#endif
81 81
82#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) 82#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
@@ -84,8 +84,8 @@
84#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 84#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
85 85
86#ifndef __CHECKER__ 86#ifndef __CHECKER__
87#define __compiletime_warning(message) __attribute__((warning(message))) 87#define __compiletime_warning(message) __attribute__((__warning__(message)))
88#define __compiletime_error(message) __attribute__((error(message))) 88#define __compiletime_error(message) __attribute__((__error__(message)))
89 89
90#ifdef LATENT_ENTROPY_PLUGIN 90#ifdef LATENT_ENTROPY_PLUGIN
91#define __latent_entropy __attribute__((latent_entropy)) 91#define __latent_entropy __attribute__((latent_entropy))
@@ -134,7 +134,7 @@
134 * optimizer that something else uses this function or variable, thus preventing 134 * optimizer that something else uses this function or variable, thus preventing
135 * this. 135 * this.
136 */ 136 */
137#define __visible __attribute__((externally_visible)) 137#define __visible __attribute__((__externally_visible__))
138 138
139/* gcc version specific checks */ 139/* gcc version specific checks */
140 140
@@ -191,7 +191,7 @@
191 * should not be applied to that function. 191 * should not be applied to that function.
192 * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 192 * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
193 */ 193 */
194#define __no_sanitize_address __attribute__((no_sanitize_address)) 194#define __no_sanitize_address __attribute__((__no_sanitize_address__))
195#endif 195#endif
196 196
197#if GCC_VERSION >= 50100 197#if GCC_VERSION >= 50100
@@ -199,7 +199,7 @@
199 * Mark structures as requiring designated initializers. 199 * Mark structures as requiring designated initializers.
200 * https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html 200 * https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
201 */ 201 */
202#define __designated_init __attribute__((designated_init)) 202#define __designated_init __attribute__((__designated_init__))
203#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 203#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
204#endif 204#endif
205 205