This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64526] New: No warning on function call with excessive arguments
- From: "chengniansun at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Jan 2015 18:56:13 +0000
- Subject: [Bug c/64526] New: No warning on function call with excessive arguments
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64526
Bug ID: 64526
Summary: No warning on function call with excessive arguments
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
GCC does not warn on the following function call to "fn1". The function "fn1"
is defined with no parameters. Based on the standard, the empty parameter list
in a function declarator that is part of a definition of that function
specifies that the function has no parameters.
$ cat test.c
void fn1 () {}
void fn2 (int p) { fn1 (p); }
$ gcc-trunk -Wall -Wextra -pedantic -std=c11 -c test.c
$ clang-trunk -c test.c
test.c:2:27: warning: too many arguments in call to 'fn1'
void fn2 (int p) { fn1 (p); }
~~~ ^
1 warning generated.
$