lkml.org 
[lkml]   [2002]   [Jan]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH]: 2.5.1pre9 change several if (x) BUG to BUG_ON(x)
DateSun, 6 Jan 2002 16:26:03 +0000 (GMT)
FromAlan Cox <>
> Alan> 	BUG_ON(function(x,y))
> 
> #ifdef DEBUG
> #define BUG_ON(x) if (x) BUG()
> #else
> #define BUG_ON(x) (void)(x)
> #endif

(void)(x) may cause x not be evaluated if the compiler can optimise it out
on the grounds that the result is discarded. Fortunately gcc can't remove
anything that has side effects so providing there are no other bugs in the
code (eg referencing mmio addresses) it should be fine - you are correct
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:15    [W:0.172 / U:0.840 seconds]
©2003-2008 Jasper Spaans