This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C attribute parsing patch


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]