lkml.org 
[lkml]   [2004]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [2.6 patch][1/3] ipc/ BUG -> BUG_ON conversions
    Date
    Quoting Adrian Bunk <bunk@fs.tum.de>:
    > > Anything you put in BUG_ON() must *NOT* have side effects.
    > >...
    >
    > I'd have said exactly the same some time ago, but I was convinced by
    > Arjan that if done correctly, a BUG_ON() with side effects is possible
    > with no extra cost even if you want to make BUG configurably do nothing.

    #if is_debugging_on
    # define BUG_ON(x) do { if (unlikely(x)) BUG(); } while (0)
    #else
    # define BUG_ON(x) do { if (x) { /* nothing */ } } while (0)
    #endif

    > cu
    > Adrian
    >

    --
    Regards Michael Buesch [ http://www.tuxsoft.de.vu ]

    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2005-03-22 14:05    [W:0.020 / U:30.216 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site