This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16833] New: -fno-builtin prevents automatic format checks for standard functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]