Make pascal strings work in initializers

This commit is contained in:
Wolfgang Thaller 2014-11-08 00:32:00 +01:00
parent 5426b3a741
commit e004916be5
2 changed files with 4 additions and 4 deletions

View File

@ -6553,7 +6553,7 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype,
if (char_array) if (char_array)
{ {
if (typ2 != char_type_node) if (typ2 != char_type_node && typ2 != unsigned_char_type_node)
{ {
error_init ("char-array initialized from wide string"); error_init ("char-array initialized from wide string");
return error_mark_node; return error_mark_node;
@ -6561,7 +6561,7 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype,
} }
else else
{ {
if (typ2 == char_type_node) if (typ2 == char_type_node || typ2 == unsigned_char_type_node)
{ {
error_init ("wide character array initialized from non-wide " error_init ("wide character array initialized from non-wide "
"string"); "string");

View File

@ -970,7 +970,7 @@ digest_init_r (tree type, tree init, bool nested, int flags,
if (TYPE_PRECISION (typ1) == BITS_PER_UNIT) if (TYPE_PRECISION (typ1) == BITS_PER_UNIT)
{ {
if (char_type != char_type_node) if (char_type != char_type_node && char_type != unsigned_char_type_node)
{ {
if (complain & tf_error) if (complain & tf_error)
error ("char-array initialized from wide string"); error ("char-array initialized from wide string");
@ -979,7 +979,7 @@ digest_init_r (tree type, tree init, bool nested, int flags,
} }
else else
{ {
if (char_type == char_type_node) if (char_type == char_type_node || char_type == unsigned_char_type_node)
{ {
if (complain & tf_error) if (complain & tf_error)
error ("int-array initialized from non-wide string"); error ("int-array initialized from non-wide string");