This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16833] -fno-builtin prevents automatic format checks for standard functions
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2004 15:39:24 -0000
- Subject: [Bug c/16833] -fno-builtin prevents automatic format checks for standard functions
- References: <20040730123357.16833.timb@bluearc.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-30 15:39 -------
The documentation changed:
-Wformat
Check calls to printf and scanf, etc., to make sure that the arguments supplied have types appropriate
to the format string specified, and that the conversions specified in the format string make sense. This
includes standard functions, and others specified by format attributes (see Function Attributes), in the
printf, scanf, strftime and strfmon (an X/Open extension, not in the C standard) families (or other
target-specific families).
The formats are checked against the format features supported by GNU libc version 2.2. These include
all ISO C90 and C99 features, as well as features from the Single Unix Specification and some BSD and
GNU extensions. Other library implementations may not support all these features; GCC does not
support warning about features that go beyond a particular library's limitations. However, if -pedantic
is used with -Wformat, warnings will be given about format features not in the selected standard
version (but not for strfmon formats, since those are not in any version of the C standard). See Options
Controlling C Dialect .
Since -Wformat also checks for null format arguments for several functions, -Wformat also implies -
Wnonnull.
-Wformat is included in -Wall. For more control over some aspects of format checking, the options -
Wformat-y2k, -Wno-format-extra-args, -Wno-format-zero-length, -Wformat-nonliteral, -Wformat-
security, and -Wformat=2 are available, but are not included in -Wall.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |documentation
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16833