From: johanknol Date: Tue, 21 Aug 2001 10:30:42 +0000 (+0000) Subject: fixed bug #453370 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c7b7369e3a3570adbe87810a2058902b98f807f6;p=fw%2Fsdcc fixed bug #453370 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1158 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCval.c b/src/SDCCval.c index 2f5b9710..357b503e 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -1311,7 +1311,7 @@ getNelements (sym_link * type, initList * ilist) 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; @@ -1321,12 +1321,12 @@ getNelements (sym_link * type, initList * ilist) 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;