On Jun 4, 2010, at 8:34 AM, jonat...@mugginsoft.com wrote:

> Thanks for persisting Ken.

You're welcome.

> In general it would seem that when a  method/function has format + va_list 
> signature
> invocations should not contain single variable argument lists.

> The following regex is reasonably effective at finding the issue: 
> NSLog\([...@]

The compiler will actually find this for you.  Enabling -Wformat (which is 
included in -Wall) issues warnings for functions and methods that take format 
strings if you supply a non-literal format argument and no arguments.  If you 
supply a literal format string, then the compiler checks the format specifiers 
in it against the types of the arguments you pass.  If there's a mismatch in 
number or type, it warns for that, too.

The current SDKs decorate such functions and methods in Cocoa with the 
attribute marking them as such.  (The compiler automatically knows about C 
library functions, like printf.)

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to