This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16833] New: -fno-builtin prevents automatic format checks for standard functions
- From: "timb at bluearc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2004 12:34:08 -0000
- Subject: [Bug c/16833] New: -fno-builtin prevents automatic format checks for standard functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The documentation for the format function attribute says: "The compiler always
(unless -ffreestanding is used) checks formats for the standard library
functions ... whenever such warnings are requested". However, these implicit
attributes appear to be disabled also by -fno-builtin (which is implied by
-ffreestanding).
At the very least, the docs and the actual behaviour should match; but I think
the current behaviour is incorrect, as without -ffreestanding it is still a
hosted implementation, so printf etc. should be assumed to be standard.
Test case: compile this code with -Wformat and with/without -fno-builtin:
int printf(const char* format, ...);
void foo(void)
{
printf("%s");
}
--
Summary: -fno-builtin prevents automatic format checks for
standard functions
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: timb at bluearc dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i486-linux
GCC host triplet: i486-linux
GCC target triplet: i486-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16833