Re: NSLog() replacement for debugger output
Re: NSLog() replacement for debugger output
- Subject: Re: NSLog() replacement for debugger output
- From: "Michael Ash" <email@hidden>
- Date: Thu, 24 Apr 2008 23:09:28 -0400
On Thu, Apr 24, 2008 at 9:26 PM, Herb Petschauer <email@hidden> wrote:
> Yes, good point. I _thought_ there was a good example of why to use
> the while false pattern but it's so far back in time that I can't
> recall it. The only thing that I can find is
> <http://c-faq.com/cpp/multistmt.html> which really doesn't apply in
> this example.
>
> Ah well, I know I've been burned by this but it may have just been a
> by product of using it for a different kind of macro under a different
> compiler.
It's only useful for multi-statement macros. The idea is that a macro
looks like a single statement so it should act like one, and
do/while(0) is the only way in C to transform a sequence of statements
into a single statement. If your macro is already a single statement
then it doesn't do anything particularly interesting.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden