Messages in this thread | | | Date | Sat, 30 Aug 2008 03:38:15 +0400 | From | Alexey Dobriyan <> | Subject | Re: [PATCH] BUILD_BUG_ON() should not use array type |
| |
> > +/* Force a compilation error if condition is constant and true */ > > +#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) > > 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,
Yes, please. There should be no maybes in kernel.
Imagine probabilistic BUG_ON(). Imagine probabilistic refcounting: maybe_get_net().
| |