From: H. Peter Anvin Date: Wed, 25 Feb 2009 23:22:19 +0000 (-0800) Subject: compiler-gcc4: conditionalize #error on __KERNEL__ X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee;p=linux-beck.git compiler-gcc4: conditionalize #error on __KERNEL__ Impact: Fix for exported headers We only want to error out on specific gcc versions if we are actually building the kernel, so conditionalize the #if...#error on __KERNEL__. Based on a patchset by Arnd Bergmann . Cc: Arnd Bergmann Signed-off-by: H. Peter Anvin Signed-off-by: Ingo Molnar --- diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 09992718f9e8..450fa597c94d 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -3,8 +3,10 @@ #endif /* GCC 4.1.[01] miscompiles __weak */ -#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 -# error Your version of gcc miscompiles the __weak directive +#ifdef __KERNEL__ +# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 +# error Your version of gcc miscompiles the __weak directive +# endif #endif #define __used __attribute__((__used__))