[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

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 23 12:59:00 GMT 2017


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."


More information about the Gcc-bugs mailing list