WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [patch] Lets not put statements with side-effects inside

To: Arjan van de Ven <arjanv@xxxxxxxxxx>
Subject: Re: [Xen-devel] [patch] Lets not put statements with side-effects inside BUG_ON()
From: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Date: Thu, 27 Oct 2005 19:04:01 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 27 Oct 2005 17:01:19 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20051027102912.GB14158@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20051027102912.GB14158@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
On Thu, Oct 27, 2005 at 12:29:12PM +0200, Arjan van de Ven wrote:

> BUG_ON() is a macro very very similar to assert(), and it's a really bad
> idea in general to put statements with side-effects inside such a construct
> (for example the BUG_ON() could be compiled away for non-debug builds).
> 
> The patch below fixes this for the drivers/xen tree.

I'd like to see this applied, to both Xen and the vanilla kernel;
however, it should be noted that no version of Linux or Xen compiles
BUG_ON() away without evaluating its arguments.

Cheers,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel