fixed bug #524211
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 1 Mar 2002 10:44:11 +0000 (10:44 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 1 Mar 2002 10:44:11 +0000 (10:44 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1962 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglue.c

index 9861c9855feb2a0eb3095f334d35cd047fe227fa..d74cfb612eb973c5ff0e4f1f39b0cca6dbdb0498 100644 (file)
@@ -970,8 +970,10 @@ printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
       return;
 
   /* check the type      */
-  if (compareType (type, val->type) == 0)
+  if (compareType (type, val->type) == 0) {
     werror (W_INIT_WRONG);
+    printFromToType (type, val->type);
+  }
 
   /* if val is literal */
   if (IS_LITERAL (val->etype))
@@ -1027,6 +1029,9 @@ printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
   if (!ilist)
     return;
 
+  /* update line number for error msgs */
+  lineno=sym->lineDef;
+
   /* if structure then    */
   if (IS_STRUCT (type))
     {