[Bug c/26494] New: -pedantic-errors can be overridden by -W*

fn_x at hotmail dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 28 11:35:00 GMT 2006


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



More information about the Gcc-bugs mailing list