* support/scripts/listerr.c: program to create the list of errors and
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 22 Apr 2007 15:57:03 +0000 (15:57 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 22 Apr 2007 15:57:03 +0000 (15:57 +0000)
  warnings list from - added
* doc/sdccman.lyx: removed the note
  "For list of warnings and corresponding codes, see err_warn.txt"
* src/SDCCsymt.c: fixed bug #1699804:
  Bug with some uses of sizeof(static local array) (MCS51)
* support/regression/tests/test-1699804.c: added

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4762 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCsymt.c

index 5c7d017a15280c4a1274d74f2a64218aed238991..e1a32e3ce5c905fbf6df9e48e90b9da6def36722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
          warnings list from - added
        * doc/sdccman.lyx: removed the note
          "For list of warnings and corresponding codes, see err_warn.txt"
+       * src/SDCCsymt.c: fixed bug #1699804:
+         Bug with some uses of sizeof(static local array) (MCS51)
+       * support/regression/tests/test-1699804.c: added
 
 2007-04-20 Maarten Brock <sourceforge.brock AT dse.nl>
 
index 205ea31264d1b1d62e30b1d868ec0f77da02f18a..618b092f13beec29e85c1d372fa28d6a45c1f6be 100644 (file)
@@ -1074,11 +1074,19 @@ addSymChain (symbol ** symHead)
 
       if (!sym->level && !(IS_SPEC(sym->etype) && IS_TYPEDEF(sym->etype)))
         checkDecl (sym, 0);
+      else
+        {
+          /* if this is an array without any dimension
+             then update the dimension from the initial value */
+          if (IS_ARRAY (sym->type) && !DCL_ELEM (sym->type))
+            DCL_ELEM (sym->type) = getNelements (sym->type, sym->ival);
+        }
 
       /* if already exists in the symbol table then check if
-         one of them is an extern definition if yes then
-         then check if the type match, if the types match then
-         delete the current entry and add the new entry      */
+           one of them is an extern definition;
+         if yes then then check if the type match;
+         if the types match then delete the current entry and
+           add the new entry */
       if ((csym = findSymWithLevel (SymbolTab, sym)) &&
           csym->level == sym->level)
         {