aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r--include/linux/compiler-gcc.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f1a7492a5cc8..fd282c7d3e5e 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -347,3 +347,28 @@
347#if GCC_VERSION >= 50100 347#if GCC_VERSION >= 50100
348#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 348#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
349#endif 349#endif
350
351/*
352 * Turn individual warnings and errors on and off locally, depending
353 * on version.
354 */
355#define __diag_GCC(version, severity, s) \
356 __diag_GCC_ ## version(__diag_GCC_ ## severity s)
357
358/* Severity used in pragma directives */
359#define __diag_GCC_ignore ignored
360#define __diag_GCC_warn warning
361#define __diag_GCC_error error
362
363/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */
364#if GCC_VERSION >= 40600
365#define __diag_str1(s) #s
366#define __diag_str(s) __diag_str1(s)
367#define __diag(s) _Pragma(__diag_str(GCC diagnostic s))
368#endif
369
370#if GCC_VERSION >= 80000
371#define __diag_GCC_8(s) __diag(s)
372#else
373#define __diag_GCC_8(s)
374#endif