Iain Hibbert
2012-03-17 08:36:17 UTC
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
@@ -453,13 +453,13 @@ 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));
}
;
ib2: { }
..can anybody confirm this is right?
while here though, I wonder when the patterns without the preceding
abstract_declarator will match, do I need to handle attributes there also?
regards,
iain
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
@@ -453,13 +453,13 @@ 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));
}
;
ib2: { }
..can anybody confirm this is right?
while here though, I wonder when the patterns without the preceding
abstract_declarator will match, do I need to handle attributes there also?
regards,
iain