From: borutr Date: Sun, 22 Apr 2007 15:57:03 +0000 (+0000) Subject: * support/scripts/listerr.c: program to create the list of errors and X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=5b97ceaa0f715acbfcb08be5523bbdd9c90be9c1;p=fw%2Fsdcc * support/scripts/listerr.c: program to create the list of errors and 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 --- diff --git a/ChangeLog b/ChangeLog index 5c7d017a..e1a32e3c 100644 --- 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 diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 205ea312..618b092f 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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) {