From 8d27b83ad215d62145d2837388928355d64f35c6 Mon Sep 17 00:00:00 2001 From: borutr Date: Mon, 29 Oct 2007 21:35:44 +0000 Subject: [PATCH] * src/SDCCsymt.c: reverted bad fixed of bug #1805702 - 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 | 7 +++++++ src/SDCCsymt.c | 17 +++++------------ support/regression/tests/bug-1805702.c | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8d02344..75adf0e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-29 Borut Razem + + * 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 * src/ds390/peeph.def: replaced 24bitModeAndPortDS390 by diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index ab99e717..1e02f3cd 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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); diff --git a/support/regression/tests/bug-1805702.c b/support/regression/tests/bug-1805702.c index faafb194..1b92e04a 100644 --- a/support/regression/tests/bug-1805702.c +++ b/support/regression/tests/bug-1805702.c @@ -1,6 +1,8 @@ /* bug-1805702.c */ +/* disabled */ +#if 0 #include int foo; @@ -13,3 +15,4 @@ test(void) ASSERT(foo == 10); } +#endif -- 2.30.2