diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/compiler.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index ee7239ea1583..64fdfe1cfcf0 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -323,9 +323,18 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
323 | #endif | 323 | #endif |
324 | #ifndef __compiletime_error | 324 | #ifndef __compiletime_error |
325 | # define __compiletime_error(message) | 325 | # define __compiletime_error(message) |
326 | # define __compiletime_error_fallback(condition) \ | 326 | /* |
327 | * Sparse complains of variable sized arrays due to the temporary variable in | ||
328 | * __compiletime_assert. Unfortunately we can't just expand it out to make | ||
329 | * sparse see a constant array size without breaking compiletime_assert on old | ||
330 | * versions of GCC (e.g. 4.2.4), so hide the array from sparse altogether. | ||
331 | */ | ||
332 | # ifndef __CHECKER__ | ||
333 | # define __compiletime_error_fallback(condition) \ | ||
327 | do { ((void)sizeof(char[1 - 2 * condition])); } while (0) | 334 | do { ((void)sizeof(char[1 - 2 * condition])); } while (0) |
328 | #else | 335 | # endif |
336 | #endif | ||
337 | #ifndef __compiletime_error_fallback | ||
329 | # define __compiletime_error_fallback(condition) do { } while (0) | 338 | # define __compiletime_error_fallback(condition) do { } while (0) |
330 | #endif | 339 | #endif |
331 | 340 | ||