lkml.org 
[lkml]   [2008]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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().



    \
     
     \ /
      Last update: 2008-08-30 01:39    [W:0.019 / U:150.876 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site