From: Anthony Liguori <anthony@codemonkey.ws>
To: Luciano Miguel Ferreira Rocha <strange@nsk.no-ip.org>
Cc: xen-devel@lists.sourceforge.net
Subject: Re: debugging frustration
Date: Mon, 14 Feb 2005 10:41:25 -0600 [thread overview]
Message-ID: <4210D4B5.10504@codemonkey.ws> (raw)
In-Reply-To: <20050214161419.GB2719@nsk.no-ip.org>
Luciano Miguel Ferreira Rocha wrote:
>Yes, but an empty macro results in the same thing as a do {} while (0)
>
>
a = b
debug_printf("Message");
compiles cleanly if DEBUG is #define'd as ''
At the end of the day, we're dealing with a very imperfect system
(cpp). My philosophy on debug() macro's is that they should always map
1-1 to a real function and simply provide that function with __LINE__,
__FUNCTION__, and __FILE__.
If you're really concerned about performance, you can #ifdef DEBUG the
body of the function and most compilers will correctly do nothing for
those calls.
If it's any consolation, the next submission of VM-Tools will have a set
of logging functions. I can certainly submit patches to xcs and friends
to use these functions..
Regards,
>if (ptr == null)
> ;
>else
> *ptr = 2
>
>The only problem is when the macro has some code (AFAIK).
>
>
--
Anthony Liguori
anthony@codemonkey.ws
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
prev parent reply other threads:[~2005-02-14 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-14 14:20 debugging frustration Arthur Bergman
2005-02-14 14:24 ` Mark Williamson
2005-02-14 15:03 ` Anthony Liguori
2005-02-14 16:14 ` Luciano Miguel Ferreira Rocha
2005-02-14 16:38 ` Mark Williamson
2005-02-14 16:41 ` Anthony Liguori [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=4210D4B5.10504@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=strange@nsk.no-ip.org \
--cc=xen-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.