@@ -1717,7 +1717,12 @@ static struct token *abstract_array_declarator(struct token *token, struct symbo
has_static |= (sym->op->type & KW_STATIC);
token = token->next;
}
- token = assignment_expression(token, &expr);
+ if (match_op(token, '*') && match_op(token->next, ']')) {
+ // FIXME: '[*]' is treated like '[]'
+ token = token->next;
+ } else {
+ token = assignment_expression(token, &expr);
+ }
sym->array_size = expr;
return token;
}
@@ -5,5 +5,4 @@ void ok9(int a[const volatile restrict *]);
/*
* check-name: abstract-array-declarator-star
- * check-known-to-fail
*/
Since C99, a '*' is allowed in an abstract array declarator to specify that the array is a VLA with a yet-to-be-determined size. So, accept this construction (but still ignore it for now). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- parse.c | 7 ++++++- validation/abstract-array-declarator-star.c | 1 - 2 files changed, 6 insertions(+), 2 deletions(-)