• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: format string warnings for printf vs NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: format string warnings for printf vs NSString
      • From: Jens Alfke <email@hidden>
    • Re: format string warnings for printf vs NSString
      • From: Sean McBride <email@hidden>
References: 
 >format string warnings for printf vs NSString (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: pass info to subproject
  • Next by Date: Re: pass info to subproject
  • Previous by thread: format string warnings for printf vs NSString
  • Next by thread: Re: format string warnings for printf vs NSString
  • Index(es):
    • Date
    • Thread