Skip to content

Commit 2fb0815

Browse files
groecktorvalds
authored andcommitted
gcc4: disable __compiletime_object_size for GCC 4.6+
__builtin_object_size is known to be broken on gcc 4.6+. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48880 for details. This causes unnecssary build warnings and errors such as In function 'copy_from_user', inlined from 'sb16_copy_from_user' at sound/oss/sb_audio.c:878:22: arch/x86/include/asm/uaccess_32.h:211:26: error: call to 'copy_from_user_overflow' declared with attribute error: copy_from_user() buffer size is not provably correct make[3]: [sound/oss/sb_audio.o] Error 1 (ignored) Disable it where broken. Signed-off-by: Guenter Roeck <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 657eee7 commit 2fb0815

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/compiler-gcc4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define __must_check __attribute__((warn_unused_result))
1414
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
1515

16-
#if GCC_VERSION >= 40100
16+
#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
1717
# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
1818
#endif
1919

0 commit comments

Comments
 (0)