WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] debugging frustration

> if (ptr == null)
>     ;
> else
>     *ptr = 2
>
> The only problem is when the macro has some code (AFAIK).

Using a "do {} while(0)" makes the compilation fail if you use the macro 
somewhere it wouldn't be valid when debugging enabled.  Otherwise, you could 
end up developing with debugging turned off and not notice the macro is being 
misused until someone turns it on.

Having a dummy statement helps catch this kind of error.

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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>