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.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 681d866efb1e..87c776c3ce73 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -314,29 +314,14 @@ static inline void *offset_to_ptr(const int *off)
314#endif 314#endif
315#ifndef __compiletime_error 315#ifndef __compiletime_error
316# define __compiletime_error(message) 316# define __compiletime_error(message)
317/*
318 * Sparse complains of variable sized arrays due to the temporary variable in
319 * __compiletime_assert. Unfortunately we can't just expand it out to make
320 * sparse see a constant array size without breaking compiletime_assert on old
321 * versions of GCC (e.g. 4.2.4), so hide the array from sparse altogether.
322 */
323# ifndef __CHECKER__
324# define __compiletime_error_fallback(condition) \
325 do { ((void)sizeof(char[1 - 2 * condition])); } while (0)
326# endif
327#endif
328#ifndef __compiletime_error_fallback
329# define __compiletime_error_fallback(condition) do { } while (0)
330#endif 317#endif
331 318
332#ifdef __OPTIMIZE__ 319#ifdef __OPTIMIZE__
333# define __compiletime_assert(condition, msg, prefix, suffix) \ 320# define __compiletime_assert(condition, msg, prefix, suffix) \
334 do { \ 321 do { \
335 int __cond = !(condition); \
336 extern void prefix ## suffix(void) __compiletime_error(msg); \ 322 extern void prefix ## suffix(void) __compiletime_error(msg); \
337 if (__cond) \ 323 if (!(condition)) \
338 prefix ## suffix(); \ 324 prefix ## suffix(); \
339 __compiletime_error_fallback(__cond); \
340 } while (0) 325 } while (0)
341#else 326#else
342# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0) 327# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)