• 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: wprintf does not honor "Typecheck calls to printf/scanf" setting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wprintf does not honor "Typecheck calls to printf/scanf" setting


  • Subject: Re: wprintf does not honor "Typecheck calls to printf/scanf" setting
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 4 Dec 2009 11:08:06 -0500
  • Organization: Rogue Research Inc.

On 12/4/09 12:43 PM, Ben Staveley-Taylor said:

>I have just fixed a bug in my own code which would have been spotted far
>earlier by a compiler warning. I was not passing enough parameters to printf.
>
>If I do :
>	printf("%s%s", "test");
>I correctly get the warning "warning: too few arguments for format"
>
>But as I am using wchar_t versions of everything (for cross-platform
>code reasons) I do this:
>	wprintf(L"%S%S", L"test");
>And not a peep from the compiler. No warning. Just a crash when you run it.
>
>I have the "Typecheck calls to printf/scanf" option on. Is there another
>option to set to enable the warning for wchar_t code?

I don't think so.  That warning only works in some cases, as you have
seen.  It only started working with NSString functions in 10.6 for
example.  It also doesn't work with the various SenTestingKit
functions.  You'll have to file a bug and/or try a different compiler.

--
____________________________________________________________
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: wprintf does not honor "Typecheck calls to printf/scanf" setting
      • From: Jens Ayton <email@hidden>
References: 
 >wprintf does not honor "Typecheck calls to printf/scanf" setting (From: Ben Staveley-Taylor <email@hidden>)

  • Prev by Date: difference between -m32 and -arch i386
  • Next by Date: Re: wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
  • Previous by thread: wprintf does not honor "Typecheck calls to printf/scanf" setting
  • Next by thread: Re: wprintf does not honor "Typecheck calls to printf/scanf" setting
  • Index(es):
    • Date
    • Thread