From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJpTh-0004O3-T5 for qemu-devel@nongnu.org; Fri, 28 Oct 2011 12:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJpTg-0006hv-OY for qemu-devel@nongnu.org; Fri, 28 Oct 2011 12:40:21 -0400 Sender: Paolo Bonzini Message-ID: <4EAADAEA.5070608@redhat.com> Date: Fri, 28 Oct 2011 18:40:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1319487523-19978-1-git-send-email-sw@weilnetz.de> <20111026125431.GC27267@stefanha-thinkpad.localdomain> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix compiler warning (always return a value) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Weil On 10/28/2011 04:39 PM, Markus Armbruster wrote: >> > >> > I'm tempted to continue the thread but at the end of the day we just >> > need to make the function compile with -NDEBUG. Using abort(3) or > Do we? > > Anyone crazy^Wadventurous enough to compile with -DNDEBUG should be > capable of configure --disable-werror. Also, I'm not really sure of the benefit of NDEBUG. For something like QEMU, hardware emulation is not going to be your bottleneck and for KVM you badly want those asserts to protect against guest-to-host escalation. If you have a really expensive check, you should wrap it inside #ifdef DEBUG. And if you use NDEBUG because you want to live on the edge and ignore possible problems, remember there's an "assert (p != NULL)" hidden before any pointer dereference, and you cannot disable that with NDEBUG. :) Paolo