This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48091] New: No warning when given function arguments mismatch earlier, old style K&R function definition
- From: "eerott at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 Mar 2011 09:36:53 +0000
- Subject: [Bug c/48091] New: No warning when given function arguments mismatch earlier, old style K&R function definition
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48091
Summary: No warning when given function arguments mismatch
earlier, old style K&R function definition
Product: gcc
Version: 4.4.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: eerott@gmail.com
Program:
----------
int test(a, b)
int a;
int b;
{
return a+b;
}
int main(void)
{
return test("foo");
}
----------
With all of these compiler options:
- gcc -Wall -Wextra --std=c99 -pedantic -O test.c
The expected output is similar to other compilers i.e.:
- a warning about arguments mismatching
(As all argument types and number of them are fully specified), or
- warning about incomplete function definition
Actual outcome:
- No warnings about anything
(With -O2, GCC inlines the function and then finds a mismatch and I of course
can use -Wold-style-definition warning option, but that's beside the point.)
GCC version:
- 4.4.5 in Debian Squeeze