[Bug c/11943] Accepts invalid declaration "int x[2, 3];" in C99 mode
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11943
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-16 13:19:31
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-16 13:19 -------
I can confirm this on the mainline (20030815).
The problem is that in the c-parse.y (really c-parse.in)
The array_declarator is defined as follows:
array_declarator:
'[' maybe_type_quals_attrs expr ']'
{ $$ = build_array_declarator ($3, $2, 0, 0); }
| '[' maybe_type_quals_attrs ']'
{ $$ = build_array_declarator (NULL_TREE, $2, 0, 0); }
| '[' maybe_type_quals_attrs '*' ']'
{ $$ = build_array_declarator (NULL_TREE, $2, 0, 1); }
| '[' STATIC maybe_type_quals_attrs expr ']'
{ $$ = build_array_declarator ($4, $3, 1, 0); }
/* declspecs_nosc_nots is a synonym for type_quals_attrs. */
| '[' declspecs_nosc_nots STATIC expr ']'
{ $$ = build_array_declarator ($4, $2, 1, 0); }
;
which is different from what C99 says.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply to: