lkml.org 
[lkml]   [2004]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: What policy for BUG_ON()?
On Mon, Aug 30 2004, Arjan van de Ven wrote:
> On Mon, 2004-08-30 at 22:15, Adrian Bunk wrote:
> > Let me try to summarize the different options regarding BUG_ON,
> > concerning whether the argument to BUG_ON might contain side effects,
> > and whether it should be allowed in some "do this only if you _really_
> > know what you are doing" situations to let BUG_ON do nothing.
> >
> > Options:
> > 1. BUG_ON must not be defined to do nothing
> > 1a. side effects are allowed in the argument of BUG_ON
> > 1b. side effects are not allowed in the argument of BUG_ON
> > 2. BUG_ON is allowed to be defined to do nothing
> > 2a. side effects are allowed in the argument of BUG_ON
> > 2b. side effects are not allowed in the argument of BUG_ON
>
> since you quoted me earlier my 2 cents:
> 1) I would prefer BUG_ON() arguments to not have side effects; its just
> cleaner that way. (similar to assert)
>
> 2) if one wants to compiel out BUG_ON, I rather alias it to panic() than
> to nothing.

I agree completely with that.

--
Jens Axboe

-
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 14:05    [W:0.057 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site