From: Daniel Santos Date: Fri, 22 Feb 2013 00:41:52 +0000 (-0800) Subject: bug.h: make BUILD_BUG_ON generate compile-time error X-Git-Tag: v3.9-rc1~114^2~156 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3ccc497cd17147713363a4bf975f1a269fadb6d;p=pandora-kernel.git bug.h: make BUILD_BUG_ON generate compile-time error Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This patch modifies BUILD_BUG_ON to behave like BUILD_BUG already does, using the error function attribute so that you don't have to build the entire kernel to discover that you have a problem, and then enjoy trying to track it down from a link-time error. Also, we are only including asm/bug.h and then expecting that linux/compiler.h will eventually be included to define __linktime_error (used in BUILD_BUG_ON). This patch includes it directly for clarity and to avoid the possibility of changes in /*/include/asm/bug.h being changed or not including linux/compiler.h for some reason. Signed-off-by: Daniel Santos Acked-by: Borislav Petkov Cc: Andi Kleen Cc: David Rientjes Cc: Joe Perches Cc: Josh Triplett Cc: Paul Gortmaker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed