[Bug c/48091] New: No warning when given function arguments mismatch earlier, old style K&R function definition
eerott at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Mar 12 09:36:00 GMT 2011
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
More information about the Gcc-bugs
mailing list