Re: wprintf does not honor "Typecheck calls to printf/scanf" setting
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