qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>
Subject: Re: [Qemu-devel] [PATCH] Fix compiler warning (always return a value)
Date: Fri, 28 Oct 2011 18:40:10 +0200	[thread overview]
Message-ID: <4EAADAEA.5070608@redhat.com> (raw)
In-Reply-To: <m3ehxxfae3.fsf@blackfin.pond.sub.org>

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

      reply	other threads:[~2011-10-28 16:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 20:18 [Qemu-devel] [PATCH] Fix compiler warning (always return a value) Stefan Weil
2011-10-26 12:54 ` Stefan Hajnoczi
2011-10-26 16:35   ` [Qemu-devel] [PATCH] Fix compiler warning (always return a value), introduce qemu_abort? Stefan Weil
2011-10-26 17:49     ` Blue Swirl
2011-10-26 18:34       ` [Qemu-devel] [RFC] Introduce qemu_abort? (was: Fix compiler warning (always return a value)) Stefan Weil
2011-10-26 18:48         ` Blue Swirl
2011-10-26 20:36         ` Peter Maydell
2011-10-28  7:53           ` [Qemu-devel] [RFC] Introduce qemu_abort? Markus Armbruster
2011-10-27  7:11     ` [Qemu-devel] [PATCH] Fix compiler warning (always return a value), introduce qemu_abort? Stefan Hajnoczi
2011-10-27  8:24     ` Alexander Graf
2011-10-28  7:40   ` [Qemu-devel] [PATCH] Fix compiler warning (always return a value) Markus Armbruster
2011-10-28  8:49     ` Stefan Hajnoczi
2011-10-28  8:59       ` Markus Armbruster
2011-10-28  9:02         ` Stefan Hajnoczi
2011-10-28 11:07           ` Markus Armbruster
2011-10-28 12:41             ` Stefan Hajnoczi
2011-10-28 14:39               ` Markus Armbruster
2011-10-28 16:40                 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EAADAEA.5070608@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).