Re: Newbie warning: watch your NSLog data types
Re: Newbie warning: watch your NSLog data types
- Subject: Re: Newbie warning: watch your NSLog data types
- From: Guy English <email@hidden>
- Date: Tue, 9 Aug 2005 14:48:18 -0400
> It would be very nice if there were an NSLog debug mode that did
> (limited) type checking on arguments. I am still trying to figure
> out how to write that - any 16 bits is a valid int16, which is not
> easy to debug.
This can't be checked at run-time because of the way the varargs stuff
works. I believe GCC can do some printf format checking during parsing
and give warnings. Can't remember the details off the top of my head
but you may be able to declare a function with an attribute saying to
check the args for printf style type correctness. Whether or not it'll
gracefully handle Cocoa-extended printf formats I don't know.
Take care,
Guy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden