Re: NSLog() replacement for debugger output
Re: NSLog() replacement for debugger output
- Subject: Re: NSLog() replacement for debugger output
- From: "Herb Petschauer" <email@hidden>
- Date: Thu, 24 Apr 2008 21:36:43 -0700
On 24/04/2008, Michael Ash <email@hidden> wrote:
> > 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.
I think ultimately I must have gotten burned by the mult-statement
aspect of it (my ASSERT and LOG macros are rarely one line these days)
and it just became ritual (and ritual becomes law and the true reasons
are forgotten). Good to re-examine these things and realize that yes,
I'm am on schedule for becoming a grumpy curmudgeon ;-)
Sorry for the noise.
Cheers,
-H.
_______________________________________________
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