From: Mark Williamson Subject: Re: debugging frustration Date: Mon, 14 Feb 2005 14:24:38 +0000 Message-ID: <200502141424.38935.maw48@cl.cam.ac.uk> References: <6964b3969b0cbc632c2161cb16ad0e8b@fotango.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <6964b3969b0cbc632c2161cb16ad0e8b@fotango.com> Content-Disposition: inline Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel@lists.sourceforge.net Cc: Arthur Bergman List-Id: xen-devel@lists.xenproject.org > Also, is there a reason that not having DEBUG in turns dprintf into do > {} while(0) instead of just turning into "" It makes the macro behave more like a proper statement. e.g. If we try to do: if ( 1 == 2 debug_print("foo!") ) { } It won't compile, even if debugging is switched off. If we just did "#define debug_print(...)" then this would compile and we'd only notice the error when debugging was switched on. That's a quite contrived example but basically it keeps the developers honest ;-) Cheers, Mark ------------------------------------------------------- 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