From 6409d1e4c5e2c72124ef2c8f722dec8ddc31e0c3 Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 6 Apr 2001 12:33:57 +0000 Subject: [PATCH] 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 --- src/SDCCast.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ -- 2.47.2