From: Matthias Braun Date: Tue, 22 Jan 2008 22:26:00 +0000 (+0000) Subject: signed char and unsigned char can be initialized with string constants too X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=794f6e66559c033bdf9cdfa023c9726c0b0b1436;p=cparser signed char and unsigned char can be initialized with string constants too [r18844] --- 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); }