Re: [PATCH] BUILD_BUG_ON() should not use array type

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Friday, August 29, 2008 - 1:22 pm

On Fri, 29 Aug 2008 12:46:34 +0100
"Jan Beulich" <jbeulich@novell.com> wrote:


MAYBE_BUILD_BUG_ON() hurts my brain.  It's doing:

	if (__builtin_constant_p(expr))
		BUILD_BUG_ON(expr);

yes?  For inlined (or macro) callsites which can be used with constant
or non-constant args.

It's tempting to just zap the one callsite and not add this at all, but
I suppose that it's a legitimate thing to want to do, and that other
users of it may well turn up.  Many of them are probably just using run-time
BUG_ON(), which is sensible, but less efficient.

However it would benefit from a clearer description and perhaps a
better name.  BUILD_BUG_ON_IF_CONSTANT?



What does BUILD_BUG_ON_NULL() do and why did you add it?  It has no
callers.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] BUILD_BUG_ON() should not use array type, Jan Beulich, (Fri Aug 29, 4:46 am)
Re: [PATCH] BUILD_BUG_ON() should not use array type, Andrew Morton, (Fri Aug 29, 1:22 pm)
Re: [PATCH] BUILD_BUG_ON() should not use array type, Alexey Dobriyan, (Fri Aug 29, 4:38 pm)
Re: [PATCH] BUILD_BUG_ON() should not use array type, Jan Beulich, (Sun Aug 31, 11:56 pm)