aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccgen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 87c9f0d..1253d1e 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -4690,6 +4690,9 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c,
no_oblock = 1;
if ((first && tok != TOK_LSTR && tok != TOK_STR) ||
tok == '{') {
+ if (tok != '{')
+ error("character array initializer must be a literal,"
+ " optionally enclosed in braces");
skip('{');
no_oblock = 0;
}