lkml.org 
[lkml]   [2008]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much
On Mon, 7 Jan 2008 10:31:53 -0800 (PST)
Christoph Lameter <clameter@sgi.com> wrote:

> We could replace the __you_cannot_kmalloc_that_much() with a BUG()
> statement so we have the same effect in SLAB?
>

sounds like a bad idea; a compile time failure is of course nicer than
a runtime failure for the cases we can find the bug at compile-time already.

We should however investigate using one of the two following gcc function attributes;
they can give the user a lot better diagnostic information than what we have
right now:


error ("message")
If this attribute is used on a function declaration and a call to
such a function is not eliminated through dead code elimination or
other optimizations, an error which will include message will be
diagnosed. This is useful for compile time checking, especially
together with __builtin_constant_p and inline functions where checking
the inline function arguments is not possible through extern char
[(condition) ? 1 : -1]; tricks. While it is possible to leave the
function undefined and thus invoke a link failure, when using this
attribute the problem will be diagnosed earlier and with exact location
of the call even in presence of inline functions or when not emitting
debugging information.

warning ("message")
If this attribute is used on a function declaration and a call to
such a function is not eliminated through dead code elimination or
other optimizations, a warning which will include message will be
diagnosed. This is useful for compile time checking, especially
together with __builtin_constant_p and inline functions. While it is
possible to define the function with a message in .gnu.warning*
section, when using this attribute the problem will be diagnosed
earlier and with exact location of the call even in presence of inline
functions or when not emitting debugging information.

--
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org


\
 
 \ /
  Last update: 2008-01-08 05:25    [W:0.266 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site