* src/SDCCsymt.c: reverted bad fixed of bug #1805702
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2007 21:35:44 +0000 (21:35 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2007 21:35:44 +0000 (21:35 +0000)
  - order of extern matters
* support/regression/tests/bug-1805702.c: disabled regtest for bug
  #1805702

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

ChangeLog
src/SDCCsymt.c
support/regression/tests/bug-1805702.c

index e8d02344b02fd1b2d7ce86fc409e8231597521df..75adf0e3889640dfb3dd2fffa04b27aafc031794 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-29 Borut Razem <borut.razem AT siol.net>
+
+       * src/SDCCsymt.c: reverted bad fixed of bug #1805702
+         - order of extern matters
+       * support/regression/tests/bug-1805702.c: disabled regtest for bug
+         #1805702
+
 2007-10-29 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/ds390/peeph.def: replaced 24bitModeAndPortDS390 by
index ab99e717b98978c45eb5bc8d5a5b49c8ce34b380..1e02f3cdf913f7409b77673229d4ceaadd09b495 100644 (file)
@@ -1082,10 +1082,11 @@ addSymChain (symbol ** symHead)
             DCL_ELEM (sym->type) = getNelements (sym->type, sym->ival);
         }
 
-      /* if already exists in the symbol table
-         then check if the type match;
-         if yes then if at least one is not extern
-         set the new symbol to non extern  */
+      /* 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 */
       if ((csym = findSymWithLevel (SymbolTab, sym)) &&
           csym->level == sym->level)
         {
@@ -1155,14 +1156,6 @@ addSymChain (symbol ** symHead)
           if (csym->ival && !sym->ival)
             sym->ival = csym->ival;
 
-          if (!sym->cdef && IS_EXTERN (sym->etype))
-            {
-              /* set the new symbol to not extern if not a compiler defined function
-                and at least one is non extern */
-              SPEC_EXTR(sym->etype) = SPEC_EXTR(csym->etype);
-              sym->cdef = csym->cdef;
-            }
-
           /* delete current entry */
           deleteSym (SymbolTab, csym, csym->name);
           deleteFromSeg(csym);
index faafb194ac5a9b4960739832e564ed04d22de2f9..1b92e04a7793caadc4edb65cfa29e6dd5bfb9907 100644 (file)
@@ -1,6 +1,8 @@
 /* bug-1805702.c
  */
 
+/* disabled */
+#if 0
 #include <testfwk.h>
 
 int foo;
@@ -13,3 +15,4 @@ test(void)
 
   ASSERT(foo == 10);
 }
+#endif