From 794f6e66559c033bdf9cdfa023c9726c0b0b1436 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 22 Jan 2008 22:26:00 +0000 Subject: [PATCH] signed char and unsigned char can be initialized with string constants too [r18844] --- parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 752d000..0864933 100644 --- a/parser.c +++ b/parser.c @@ -963,9 +963,12 @@ static initializer_t *initializer_from_expression(type_t *type, type_t *const element_type = skip_typeref(array_type->element_type); if (element_type->kind == TYPE_ATOMIC) { + atomic_type_kind_t akind = element_type->atomic.akind; switch (expression->kind) { case EXPR_STRING_LITERAL: - if (element_type->atomic.akind == ATOMIC_TYPE_CHAR) { + if (akind == ATOMIC_TYPE_CHAR + || akind == ATOMIC_TYPE_SCHAR + || akind == ATOMIC_TYPE_UCHAR) { return initializer_from_string(array_type, &expression->string.value); } -- 2.20.1