attributes in function arguments broken

Aldy Hernandez aldyh@redhat.com
Wed Jan 16 12:29:00 GMT 2002


> Won't this end up executing
> 
>                 { pushlevel (0);
>                   clear_parm_order ();
>                   declare_parm_level (1); }
> 
> twice (once in parmlist_or_identifiers and once in parmlist)?

yes, i tried just prepending maybe_attributes to parmlist_or_identifiers_1
but then i got an ICE of:

c.c:8: tree check: expected tree_list, have identifier_node in decl_attributes, at attribs.c:278
Please submit a full bug report,

which i was investigating but i got stupefied, when this worked:

         maybe_attribute { } parmlist_1 { $$ = $3; }

but this didn't:

         maybe_attribute parmlist_1 { $$ = $2; }

what difference does the empty action do?  i looked and there were no
new shift/reduce or reduce/reduce conflicts with either version.

i'm confused.

> start of parmlist_or_identifiers (and then give a syntax error in
> parmlist_or_identifiers_1 if an identifier list rather than a parmlist is
> found after attributes).

how would i do this?

this is what i have so far that works.

aldy

Index: c-parse.in
===================================================================
RCS file: /cvs/uberbaum/gcc/c-parse.in,v
retrieving revision 1.125
diff -c -p -r1.125 c-parse.in
*** c-parse.in	2002/01/04 18:42:56	1.125
--- c-parse.in	2002/01/16 19:53:07
*************** parmlist_or_identifiers:
*** 2615,2621 ****
  	;
  
  parmlist_or_identifiers_1:
! 	  parmlist_1
  	| identifiers ')'
  		{ tree t;
  		  for (t = $1; t; t = TREE_CHAIN (t))
--- 2615,2621 ----
  	;
  
  parmlist_or_identifiers_1:
! 	  maybe_attribute { } parmlist_1 { $$ = $3; }
  	| identifiers ')'
  		{ tree t;
  		  for (t = $1; t; t = TREE_CHAIN (t))



More information about the Gcc-patches mailing list