• 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
format string warnings for printf vs NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

format string warnings for printf vs NSString


  • Subject: format string warnings for printf vs NSString
  • From: Sean McBride <email@hidden>
  • Date: Fri, 13 Jan 2012 17:37:40 -0500
  • Organization: Rogue Research Inc.

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?

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Re: Watch a Variable
  • Next by Date: pass info to subproject
  • Previous by thread: Re: Watch a Variable
  • Next by thread: Re: format string warnings for printf vs NSString
  • Index(es):
    • Date
    • Thread