[forwarded from http://bugs.debian.org/197504] int foo(void); int foo() { return 42; } $ gcc -c -Wstrict-prototypes gcc-bug.c $ Bug submitter expected gcc to raise a warning in line 3, because a function is declared with an unknown parameter list instead of an empty list. Instead, line 3 should look like "int foo(void)".
Confirmed with mainline (20030705) and current branch.
The EDG front-end doesn't get this right either.
Subject: Bug 11369 CVSROOT: /cvs/gcc Module name: gcc Changes by: hubicka@gcc.gnu.org 2003-08-23 21:18:58 Modified files: gcc : expr.c ChangeLog gcc/config/i386: i386.c i386.h i386.md Log message: PR target/11369 * i386.c (ix86_expand_carry_flag_compare): Validate operand. PR target/11031 * i386.c (const_0_to_3_operand, const_0_to_7_operand, const_0_to_15_operand, const_0_to_255_operand): New predicates. * i386.h (PREDICATE_CODES): Add these. * i386.c (pinsrw and pextrw patterns): Use them. PR target/10984 * i386.c (ix86_expand_binop_builtin): Behave sanely for VOIDmodes. PR target/8869 * expr.c (convert_modes): Deal properly with integer to vector constant conversion. PR target/8871 * i386.md (zero_extendsidi2*): Add MMX and SSE alternatives. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&r1=1.577&r2=1.578 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.864&r2=2.865 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.595&r2=1.596 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.h.diff?cvsroot=gcc&r1=1.350&r2=1.351 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.480&r2=1.481
This is invalid as the documentation talks about "prototypes" non existant: Warn about unprototyped function declarations In this case foo is prototyped. The flag you want is -Wold-style-definition instead but this only added for 3.4, closing as fixed.