Fix comment describing BUILD_BUG_ON: BUG_ON is not an assertion (unfortunately). Also implement BUILD_BUG_ON in a way that can be used outside of a function scope, so that compile time checks can be placed in convenient places (like in a header, close to the definition of related constants and data-types). Signed-off-by: Nikita Danilov include/linux/kernel.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff -puN include/linux/kernel.h~BUILD_BUG_ON-fix-comment include/linux/kernel.h --- git-linux/include/linux/kernel.h~BUILD_BUG_ON-fix-comment 2005-10-24 13:46:26.000000000 +0400 +++ git-linux-nikita/include/linux/kernel.h 2005-10-24 13:46:26.000000000 +0400 @@ -307,8 +307,9 @@ struct sysinfo { char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ }; -/* Force a compilation error if condition is false */ -#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) +/* Force a compilation error if condition is true */ +#define BUILD_BUG_ON(x) \ + void __dummy_build_bug_on(int __compile_time_assertion_failed_[-!!(x)]) #ifdef CONFIG_SYSCTL extern int randomize_va_space; _