Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cd2c29d authored by H. Peter Anvin's avatar H. Peter Anvin Committed by Ingo Molnar
Browse files

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 <arnd@arndb.de>.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3a471cbc
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -3,9 +3,11 @@
#endif
#endif


/* GCC 4.1.[01] miscompiles __weak */
/* GCC 4.1.[01] miscompiles __weak */
#ifdef __KERNEL__
# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
#  error Your version of gcc miscompiles the __weak directive
#  error Your version of gcc miscompiles the __weak directive
# endif
# endif
#endif


#define __used			__attribute__((__used__))
#define __used			__attribute__((__used__))
#define __must_check 		__attribute__((warn_unused_result))
#define __must_check 		__attribute__((warn_unused_result))