This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48091] No warning when given function arguments mismatch earlier function definition which GCC assumes to be K&R, even with --std=c99 -pedantic
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jan 2017 12:59:20 +0000
- Subject: [Bug c/48091] No warning when given function arguments mismatch earlier function definition which GCC assumes to be K&R, even with --std=c99 -pedantic
- Auto-submitted: auto-generated
- References: <bug-48091-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48091
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-01-23
Ever confirmed|0 |1
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
A better example, which doesn't get any diagnostic even with -Wpedantic, is
void f() { }
int main()
{
f(1, 2, 3);
}
C11 seems clear:
"An empty list in a function declarator that is part of a definition of that
function specifies that the function has no parameters."