fixed bug #498740
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 6 Jan 2002 15:29:55 +0000 (15:29 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 6 Jan 2002 15:29:55 +0000 (15:29 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1775 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglue.c

index 208900340a4812f2920fa37ee4e3fbca4cfc4917..9a4c15fada0e44a2015a38a621c1c55ccfb8d647 100644 (file)
@@ -738,12 +738,16 @@ printIvalArray (symbol * sym, sym_link * type, initList * ilist,
   /* take care of the special   case  */
   /* array of characters can be init  */
   /* by a string                      */
-  if (IS_CHAR (type->next))
+  if (IS_CHAR (type->next)) {
+    if (!IS_LITERAL(list2val(ilist)->etype)) {
+      werror (W_INIT_WRONG);
+      return;
+    }
     if (printIvalChar (type,
                       (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
                       oFile, SPEC_CVAL (sym->etype).v_char))
       return;
-
+  }
   /* not the special case             */
   if (ilist->type != INIT_DEEP)
     {