From: johanknol Date: Fri, 6 Apr 2001 12:33:57 +0000 (+0000) Subject: throw an error for non-constant auto initializers X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=6409d1e4c5e2c72124ef2c8f722dec8ddc31e0c3;p=fw%2Fsdcc throw an error for non-constant auto initializers git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@728 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index e5b321ca..2824561a 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1002,6 +1002,11 @@ gatherAutoInit (symbol * autoChain) SPEC_SCLS (sym->etype) != S_CODE) { symbol *newSym; + + // this can only be a constant + if (!IS_LITERAL(sym->ival->init.node->etype)) { + werror (E_CONST_EXPECTED); + } /* insert the symbol into the symbol table */ /* with level = 0 & name = rname */