On Tue, 2 Oct 2007 23:26:42 +0200 Jean Delvare <khali@linux-fr.org> wrote:
Yeah, the tricks we play in there do fool some versions of gcc, and you see
the result.
Roland came up with this:
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -145,7 +145,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
* testing it here shouldn't be needed. But some versions of gcc need
* help.
*/
- if (__builtin_constant_p(size) && index < 0) {
+ if (__builtin_constant_p(index) && index < 0) {
/*
* Generate a link failure. Would be great if we could
* do something to stop the compile here.
Does it fix things for you?
-