qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] Fix compiler warning (always return a value)


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCH] Fix compiler warning (always return a value)
Date: Fri, 28 Oct 2011 18:40:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]