Re: format string warnings for printf vs NSString
Re: format string warnings for printf vs NSString
- Subject: Re: format string warnings for printf vs NSString
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 14 Jan 2012 00:36:44 +0100
Le 13 janv. 2012 à 23:37, Sean McBride a écrit :
> Hi all,
>
> Given:
>
> printf("format %d");
> [NSString stringWithFormat:@"format %d"];
>
> With Xcode 4.2.1's clang or llvm-gcc:
>
> clang -Wall -Wextra -Wformat=2 -fsyntax-only test.m
>
> I get a warning for printf but not for NSString:
>
> warning: more '%' conversions than data arguments [-Wformat]
>
> The declarations of both are decorated with __attribute__ __format__.
>
> Why isn't it working for NSString? Didn't this used to work?
It works on function call (NSLog) but not on methods.
It look like it was never implemented in clang, so it may be worth filling a bug report about it.
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden