This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C attribute parsing patch
- To: law at cygnus dot com
- Subject: Re: C attribute parsing patch
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Mon, 26 Apr 1999 09:53:51 -0500 (CDT)
- cc: Donn Terry <donn at interix dot com>, egcs-patches at egcs dot cygnus dot com
On Mon, 26 Apr 1999, Jeffrey A Law wrote:
>
> In message <3717732D.392E1B63@interix.com>you write:
> > Jeff asked for further analysis of Mumit's patch below. Here's
> > some.
> >
> >
> > Mumit's proposed change addresses the following, where in the first
> > declaration, a syntax error is generated, in the second (with a parameter
> > name present) one is not. (Since function declarations in headers
> > should not have parameter names, this presents a problem.)
> >
> >
> > /* Syntax error, line 4 (par name absent) */
> > extern int __attribute__((__cdecl_))
> > atexit6(
> > void (__attribute__((__cdecl_)) *)(void))
> > ;
> >
> > /* No error (par name present) */
> > extern int __attribute__((__cdecl_))
> > atexit7(
> > void (__attribute__((__cdecl_)) *foo)(void))
> > ;
> A parameter name in a prototype is allowed by ANSI/ISO. Flagging it as an
> error is incorrect.
>
> Does the patch change that behavior?
>
No, it does not. It allows parsing the dec without the parameter name,
which currently gets a parse error (the 1st one).
Regards,
Mumit