This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14030] New: missing parameter count check ?
- From: "d dot binderman at virgin dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Feb 2004 13:25:52 -0000
- Subject: [Bug c/14030] New: missing parameter count check ?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Given the following broken source code
void f( one, two)
int one;
char two;
{
}
void g(int i)
{
f( 1);
f( 1, 'e', i);
}
gcc 332 says
[dcb@localhost src]$ gcc -c bad.c
[dcb@localhost src]$
gcc 332 with lots of warning flags says
[dcb@localhost src]$ gcc -c -g -O2 -Wall -ansi -pedantic bad.c
[dcb@localhost src]$
Surprising. Here is Intel compiler on the same code. Note the lack
of extra flags.
[dcb@localhost src]$ icc -c bad.c
bad.c(13): warning #165: too few arguments in function call
f( 1);
^
bad.c(14): warning #140: too many arguments in function call
f( 1, 'e', i);
^
Any chance of getting gcc to find the faults in the code, without
changing the original code from K & R to ISO ?
--
Summary: missing parameter count check ?
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot binderman at virgin dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: redhat linux on i686
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14030