Noticed while doing a test for bug #26494:
int main(char a) {}
gcc bug.c -ansi -pedantic
compiles this without any error or warning.
gcc bug.c -ansi -pedantic -Wmain
reports
bug.c:1: warning: first argument of ‘main’ should be
‘int’
bug.c:1: warning: ‘main’ takes only zero or two arguments
and compiles this.
gcc bug.c -ansi -pedantic-errors
compiles this without any error or warning.
gcc bug.c -ansi -pedantic-errors -Wmain
reports
bug.c:1: error: first argument of ‘main’ should be
‘int’
bug.c:1: error: ‘main’ takes only zero or two arguments
and does not compile this.
gcc --version:
gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--
Summary: -pedantic does not include -Wmain, but -pedantic-errors
does make -Wmain cause error messages
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: truedfx at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30551