This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37874] gcc sometimes accepts attribute in identifier list
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2008 12:48:52 -0000
- Subject: [Bug c/37874] gcc sometimes accepts attribute in identifier list
- References: <bug-37874-6809@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from joseph at codesourcery dot com 2008-10-20 12:48 -------
Subject: Re: gcc sometimes accepts attribute in identifier list
On Mon, 20 Oct 2008, sabre at nondot dot org wrote:
> as it turns out, f3 could also be considered valid in c89... because it makes x
> and y be implicit int's, not an identifier list.
All parameters need a nonempty list of declaration specifiers in a
parameter type list, which y doesn't have in that case. Implicit int in
C90 (removed in C99) means that list could just be "const", for example,
but not completely empty.
That the first parameter in a parameter type list must have some
*non-attribute* declaration specifier is documented in "Attribute Syntax"
along with the ambiguity this resolves.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37874