This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64526] 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 22:59:51 +0000
- Subject: [Bug c/64526] No warning on function call with excessive arguments
- Auto-submitted: auto-generated
- References: <bug-64526-4 at http dot gcc dot gnu dot org/bugzilla/>
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.