git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1158
4a8a32a2-be11-0410-ad9d-
d568d2c75423
ilist = ilist->init.deep;
/* if type is a character array and there is only one
- initialiser then get the length of the string */
+ (string) initialiser then get the length of the string */
if (IS_ARRAY (type) && IS_CHAR (etype) && !ilist->next)
{
ast *iast = ilist->init.node;
werror (E_INIT_WRONG);
return 0;
}
- if (!IS_ARRAY (v->type) || !IS_CHAR (v->etype))
+
+ if (IS_ARRAY (v->type) && IS_CHAR (v->etype))
+ // yep, it's a string
{
- werror (E_INIT_WRONG);
- return 0;
+ return DCL_ELEM (v->type);
}
- return DCL_ELEM (v->type);
}
i = 0;