From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arjan van de Ven Subject: Re: [patch] Lets not put statements with side-effects inside BUG_ON() Date: Thu, 27 Oct 2005 19:06:22 +0200 Message-ID: <20051027170622.GA12502@devserv.devel.redhat.com> References: <20051027102912.GB14158@devserv.devel.redhat.com> <20051027170401.GM31028@granada.merseine.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20051027170401.GM31028@granada.merseine.nu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Muli Ben-Yehuda Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Oct 27, 2005 at 07:04:01PM +0200, Muli Ben-Yehuda wrote: > 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. but it should be able to ;) yeah I agree it's not a hard bug per se, but something that should be done anyway ;)