[Bug c/64526] No warning on function call with excessive arguments
chengniansun at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 7 22:59:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64526
Chengnian Sun <chengniansun at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |---
--- Comment #2 from Chengnian Sun <chengniansun at gmail dot com> ---
(In reply to Richard Henderson from comment #1)
> Not a bug -- fn1 is not a function with no arguments,
> but an unprototyped function. To get a function with
> no arguments you must write
>
> void fn1 (void) {}
>
> This is C, not C++.
Thanks for your reply. But I am still puzzled by a paragraph in the standard
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf):
-------------- C11 standard, sec 6.7.6.3, page 134 --------------
14. An identifier list declares only the identifiers of the parameters
of the function. An empty list in a function declarator that is part of
a definition of that function specifies that the function has no
parameters. The empty list in a function declarator that is not part of
a definition of that function specifies that no information about
the number or types of the parameters is supplied.
------------------------- END -----------------------------------
So if I understand it correctly, the function "fn1" does not have any
parameters. Please kindly advise. Thanks.
More information about the Gcc-bugs
mailing list