Re: "Format not a string literal and no format arguments"
Re: "Format not a string literal and no format arguments"
- Subject: Re: "Format not a string literal and no format arguments"
- From: Ken Thomases <email@hidden>
- Date: Sat, 29 Aug 2009 16:00:31 -0500
On Aug 29, 2009, at 3:24 PM, Quincey Morris wrote:
It's actually not clear (to me) whether the two warnings are
controlled by the same compiler options. AFAIK -Wno-format (which
used to be the default in the build setting) would turn off the type
mismatch warning, but I don't know whether it would turn off the new
warning too (which seems to depend on an __attribute decoration).
GCC knows about the standard formatting functions and applies the
analysis to them automatically, by default. However, it also allows
the application of the __attribute__((format ...)) decoration to user-
defined functions to have them checked in the same way. This applies
to all of the formatting-related warnings.
There's -Wformat and -Wformat-security (among a few others). The
former checks the types, the latter also warns about a lone non-
literal argument. -Wformat-security is ignored if -Wformat is not
enabled, so -Wno-format disables both.
Both warnings are available in GCC 4.0.1, but not enabled by default.
They are apparently both enabled by default in GCC 4.2.1. (Currently,
-Wformat-security is a subset of -Wformat-nonliteral, which is
apparently not enabled by default. It warns when the format string is
a non-literal even if it's followed by arguments.)
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden