chartype = TREE_TYPE (chartype);
/* Convert a char array to an empty STRING_CST having an array
of the expected type. */
- if (!initsize)
- initsize = integer_zero_node;
+ if (INTEGRAL_TYPE_P (chartype)
+ && TYPE_PRECISION (chartype) == TYPE_PRECISION (char_type_node))
+ {
+ if (!initsize)
+ initsize = integer_zero_node;
- unsigned HOST_WIDE_INT size = tree_to_uhwi (initsize);
- init = build_string_literal (size ? 1 : 0, "", chartype, size);
- init = TREE_OPERAND (init, 0);
- init = TREE_OPERAND (init, 0);
+ unsigned HOST_WIDE_INT size = tree_to_uhwi (initsize);
+ init = build_string_literal (size ? 1 : 0, "", chartype, size);
+ init = TREE_OPERAND (init, 0);
+ init = TREE_OPERAND (init, 0);
- *ptr_offset = integer_zero_node;
+ *ptr_offset = integer_zero_node;
+ }
}
if (decl)