lkml.org 
[lkml]   [2014]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v2 5/5] bug: Make BUG() call unreachable()
    Date
    On Wednesday 26 February 2014, Josh Triplett wrote:
    > @@ -134,7 +134,7 @@ extern void warn_slowpath_null(const char *file, const int line);
    >
    > #else /* !CONFIG_BUG */
    > #ifndef HAVE_ARCH_BUG
    > -#define BUG() do {} while (0)
    > +#define BUG() do { unreachable(); } while (0)
    > #endif

    I disagree with this one. As Alan said, we really want to use an
    arch specific BUG() even in the !CONFIG_BUG case.

    For the cases where this is not yet possible, I'd suggest using

    #define BUG() do { } while (1)


    For older gcc versions, this is actually the same as unreachable(), but
    it is not the same as __builtin_unreachable, because it causes undefined
    behavior.

    Arnd


    \
     
     \ /
      Last update: 2014-02-26 22:41    [W:4.922 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site