17 Mar 2012 09:36
PCC-385: function prototypes as arguments cannot take attributes
Iain Hibbert <plunky <at> rya-online.net>
2012-03-17 08:36:17 GMT
2012-03-17 08:36:17 GMT
Hi
I was looking at the above issue posted to JIRA by me, and I think that
the problem is that abstract_declarator does not cater for attributes
after a parenthesis, probably the correct fix is below
Index: cgram.y
===================================================================
RCS file: /cvsroot/pcc/cc/ccom/cgram.y,v
retrieving revision 1.341
diff -u -p -4 -r1.341 cgram.y
--- cgram.y 3 Sep 2011 07:43:43 -0000 1.341
+++ cgram.y 17 Mar 2012 08:33:04 -0000
<at> <at> -453,13 +453,13 <at> <at> abstract_declarator:
| '(' ')' { $$ = bdty(UCALL, bdty(NAME, NULL)); }
| '(' ib2 parameter_type_list ')' {
$$ = bdty(CALL, bdty(NAME, NULL), $3);
}
- | abstract_declarator '(' ')' {
- $$ = bdty(UCALL, $1);
+ | abstract_declarator '(' ')' attr_var {
+ $$ = block(UCALL, $1, NULL, INT, 0, gcc_attr_parse($4));
}
- | abstract_declarator '(' ib2 parameter_type_list ')' {
- $$ = bdty(CALL, $1, $4);
+ | abstract_declarator '(' ib2 parameter_type_list ')' attr_var {
+ $$ = block(CALL, $1, $4, INT, 0, gcc_attr_parse($6));
}
;
(Continue reading)
I see.. but what does that even mean, is it some kind of shortcut?
iain
(will also expand the examples and put into tests)
RSS Feed