From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5txu-0006Mj-SC for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:56:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5txq-0006zK-RU for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:56:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5txq-0006z5-D8 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:56:02 -0400 From: Markus Armbruster References: <20150619095853.12531.15450.stgit@bahia.huguette.org> <20150619120638-mutt-send-email-mst@redhat.com> <20150619121512-mutt-send-email-mst@redhat.com> Date: Fri, 19 Jun 2015 12:55:57 +0200 In-Reply-To: <20150619121512-mutt-send-email-mst@redhat.com> (Michael S. Tsirkin's message of "Fri, 19 Jun 2015 12:15:50 +0200") Message-ID: <878ubgq85e.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , QEMU Developers "Michael S. Tsirkin" writes: > On Fri, Jun 19, 2015 at 11:13:40AM +0100, Peter Maydell wrote: >> On 19 June 2015 at 11:07, Michael S. Tsirkin wrote: >> > On Fri, Jun 19, 2015 at 12:00:53PM +0200, Greg Kurz wrote: >> >> In case NDEBUG is defined, assert() expands to nothing and >> >> vhost_net_set_vnet_endian() doesn't get called... >> >> >> >> Suggested-by: Thomas Huth >> >> Signed-off-by: Greg Kurz >> > >> > Not sure what the point is. >> > We don't support building with NDEBUG. >> >> Putting functional behaviour inside an assert() is still a really >> bad idea. If you're reading the code you probably skim over the >> assert() as not functionally relevant... >> >> -- PMM > > I can apply this if commit log explains it's a readability > enhancement, not a bugfix. Easy: vhost_net: fix misuse of assert() In case NDEBUG is defined, assert() expands to nothing and vhost_net_set_vnet_endian() doesn't get called... Suggested-by: Thomas Huth Signed-off-by: Greg Kurz We don't support building with NDEBUG, but putting functional behaviour inside an assert() is still a really bad idea. If you're reading the code you probably skim over the assert() as not functionally relevant... Signed-off-by: Michael S. Tsirkin"