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/26494] New: -pedantic-errors can be overridden by -W*


This simple incorrect program:

int main() { puts("Hello"); }

when compiled with gcc -std=c99 -pedantic-errors is rejected with

test.c: In function ?main?:
test.c:1: error: implicit declaration of function ?puts?

However, add -Wall to the options, and it becomes:

test.c: In function ?main?:
test.c:1: warning: implicit declaration of function ?puts?

and the program compiles and runs without errors. I think gcc should not
compile it. Also, reordering the options doesn't change anything.

Given how old this is (I can see it with gcc 3.3.6, 3.4.5, 4.0.2 and
4.1(20060223)), I'm a bit surprised if it hasn't come up before, but I searched
bugzilla and didn't find anything. Sorry for anything I missed.


-- 
           Summary: -pedantic-errors can be overridden by -W*
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fn_x at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494


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