diff options
-rw-r--r-- | parse.c | 5 | ||||
-rw-r--r-- | validation/empty-initializer.c | 1 |
2 files changed, 4 insertions, 2 deletions
@@ -3117,7 +3117,10 @@ struct token *external_declaration(struct token *token, struct symbol_list **lis for (;;) { if (!is_typedef && match_op(token, '=')) { - token = initializer(&decl->initializer, token->next); + struct token *next = token->next; + token = initializer(&decl->initializer, next); + if (token == next) + sparse_error(token->pos, "expression expected before '%s'", show_token(token)); } if (!is_typedef) { if (validate_decl) diff --git a/validation/empty-initializer.c b/validation/empty-initializer.c index 0ca763f6..95067999 100644 --- a/validation/empty-initializer.c +++ b/validation/empty-initializer.c @@ -2,7 +2,6 @@ static int i = ; // KO /* * check-name: empty-initializer - * check-known-to-fail * * check-error-start empty-initializer.c:1:16: error: expression expected before ';' |