diff options
Diffstat (limited to 'include/linux/compiler-gcc4.h')
-rw-r--r-- | include/linux/compiler-gcc4.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 662fd1b4c42a..68b162d92254 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | /* GCC 4.1.[01] miscompiles __weak */ | 5 | /* GCC 4.1.[01] miscompiles __weak */ |
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | # if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 | 7 | # if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 |
8 | # error Your version of gcc miscompiles the __weak directive | 8 | # error Your version of gcc miscompiles the __weak directive |
9 | # endif | 9 | # endif |
10 | #endif | 10 | #endif |
@@ -13,7 +13,11 @@ | |||
13 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
15 | 15 | ||
16 | #if __GNUC_MINOR__ >= 3 | 16 | #if GCC_VERSION >= 40100 |
17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
18 | #endif | ||
19 | |||
20 | #if GCC_VERSION >= 40300 | ||
17 | /* Mark functions as cold. gcc will assume any path leading to a call | 21 | /* Mark functions as cold. gcc will assume any path leading to a call |
18 | to them will be unlikely. This means a lot of manual unlikely()s | 22 | to them will be unlikely. This means a lot of manual unlikely()s |
19 | are unnecessary now for any paths leading to the usual suspects | 23 | are unnecessary now for any paths leading to the usual suspects |
@@ -29,11 +33,15 @@ | |||
29 | the kernel context */ | 33 | the kernel context */ |
30 | #define __cold __attribute__((__cold__)) | 34 | #define __cold __attribute__((__cold__)) |
31 | 35 | ||
32 | #define __linktime_error(message) __attribute__((__error__(message))) | ||
33 | |||
34 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | 36 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) |
35 | 37 | ||
36 | #if __GNUC_MINOR__ >= 5 | 38 | #ifndef __CHECKER__ |
39 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
40 | # define __compiletime_error(message) __attribute__((error(message))) | ||
41 | #endif /* __CHECKER__ */ | ||
42 | #endif /* GCC_VERSION >= 40300 */ | ||
43 | |||
44 | #if GCC_VERSION >= 40500 | ||
37 | /* | 45 | /* |
38 | * Mark a position in code as unreachable. This can be used to | 46 | * Mark a position in code as unreachable. This can be used to |
39 | * suppress control flow warnings after asm blocks that transfer | 47 | * suppress control flow warnings after asm blocks that transfer |
@@ -48,30 +56,22 @@ | |||
48 | /* Mark a function definition as prohibited from being cloned. */ | 56 | /* Mark a function definition as prohibited from being cloned. */ |
49 | #define __noclone __attribute__((__noclone__)) | 57 | #define __noclone __attribute__((__noclone__)) |
50 | 58 | ||
51 | #endif | 59 | #endif /* GCC_VERSION >= 40500 */ |
52 | #endif | ||
53 | 60 | ||
54 | #if __GNUC_MINOR__ >= 6 | 61 | #if GCC_VERSION >= 40600 |
55 | /* | 62 | /* |
56 | * Tell the optimizer that something else uses this function or variable. | 63 | * Tell the optimizer that something else uses this function or variable. |
57 | */ | 64 | */ |
58 | #define __visible __attribute__((externally_visible)) | 65 | #define __visible __attribute__((externally_visible)) |
59 | #endif | 66 | #endif |
60 | 67 | ||
61 | #if __GNUC_MINOR__ > 0 | ||
62 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
63 | #endif | ||
64 | #if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__) | ||
65 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
66 | #define __compiletime_error(message) __attribute__((error(message))) | ||
67 | #endif | ||
68 | 68 | ||
69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | 69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP |
70 | #if __GNUC_MINOR__ >= 4 | 70 | #if GCC_VERSION >= 40400 |
71 | #define __HAVE_BUILTIN_BSWAP32__ | 71 | #define __HAVE_BUILTIN_BSWAP32__ |
72 | #define __HAVE_BUILTIN_BSWAP64__ | 72 | #define __HAVE_BUILTIN_BSWAP64__ |
73 | #endif | 73 | #endif |
74 | #if __GNUC_MINOR__ >= 8 || (defined(__powerpc__) && __GNUC_MINOR__ >= 6) | 74 | #if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) |
75 | #define __HAVE_BUILTIN_BSWAP16__ | 75 | #define __HAVE_BUILTIN_BSWAP16__ |
76 | #endif | 76 | #endif |
77 | #endif | 77 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |