[Libvir] [PATCH] Check calls to printf-like functions (and some fixes)
Daniel P. Berrange
berrange at redhat.com
Mon Mar 12 17:25:15 UTC 2007
On Mon, Mar 12, 2007 at 05:16:52PM +0000, Richard W.M. Jones wrote:
> * Fix qemudDebug when debug not enabled
Its not clear what was broken about the existing code ?
This chunk:
> #ifdef ENABLE_DEBUG
> #define qemudDebug(...) qemudLog(QEMUD_DEBUG, __VA_ARGS__)
> #else
> -#define qemudDebug(fmt, ...) do { } while(0);
> +#define qemudDebug(fmt, ...)
> #endif
Will break / silently change code semantics, if qemudDebug is used in
situations like
if (foo)
qemudDebug("blah")
wizz()
Because when compiling without debug, it turns into
if (foo)
wizz()
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
More information about the libvir-list
mailing list