Skip to content

Commit

Permalink
include/linux/compiler-gcc4.h: Fix build bug - gcc-4.0.2 doesn't unde…
Browse files Browse the repository at this point in the history
…rstand __builtin_object_size

Maybe 4.1.0 doesn't too, but this fixed it for me.

Caused by:

 4a31276: x86: Turn the copy_from_user check into an (optional) compile time warning
 9f0cf4a: x86: Use __builtin_object_size() to validate the buffer size for copy_from_user()

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
LKML-Reference: <200910090724.n997OQl6013538@imap1.linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Andrew Morton authored and Ingo Molnar committed Dec 3, 2009
1 parent 99063c0 commit 7cff7ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/compiler-gcc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@

#endif

#if __GNUC_MINOR__ > 0
#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
#endif
#if __GNUC_MINOR__ >= 4
#define __compiletime_warning(message) __attribute__((warning(message)))
#define __compiletime_error(message) __attribute__((error(message)))
Expand Down

0 comments on commit 7cff7ce

Please sign in to comment.