From 5ec86507972e4b25f3acd259f5e05f65f17fa70c Mon Sep 17 00:00:00 2001 From: borutr Date: Fri, 9 Feb 2007 21:33:07 +0000 Subject: [PATCH] * src/SDCC.y: fixed bug #1159134: invalid duplicate declarations with same scope git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4625 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 9 +++++++++ src/SDCC.y | 19 ++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80c171bd..b4ef0b15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-09 Borut Razem + + * src/SDCC.y: fixed bug #1159134: invalid duplicate declarations with + same scope + 2007-02-07 Maarten Brock * src/mcs51/gen.c (aopPut): use direct name for pushing registers @@ -25,6 +30,10 @@ * src/SDCCBlock.c (addiCodeToeBBlock): fixed bug 1652207: GOTO icodes appended by loop induction must be at the very end of the eBBlock +2007-02-05 Kevin Vigor + + * src/ds390/gen.c, src/ds390/main.c: Address bug 1469393. + 2007-02-05 Borut Razem * support/regression/fwk/lib/timeout.c: native WIN32 port, diff --git a/src/SDCC.y b/src/SDCC.y index e7bf6d42..1ffd9a4e 100644 --- a/src/SDCC.y +++ b/src/SDCC.y @@ -1018,9 +1018,7 @@ opt_assign_expr $$ = cenum = constVal(lbuff); } else { - SNPRINTF(lbuff, sizeof(lbuff), - "%d",0); - $$ = cenum = constVal(lbuff); + $$ = cenum = constVal("0"); } } ; @@ -1450,15 +1448,12 @@ end_block : '}' { currBlockno = STACK_POP(blockNum); } ; compound_statement - : start_block end_block { $$ = createBlock(NULL,NULL); } - | start_block statement_list end_block { $$ = createBlock(NULL,$2) ; } + : start_block end_block { $$ = createBlock(NULL, NULL); } + | start_block statement_list end_block { $$ = createBlock(NULL, $2); } + | start_block declaration_list end_block { $$ = createBlock($2, NULL); } | start_block - declaration_list { addSymChain(&$2); } - end_block { $$ = createBlock($2,NULL) ; } - | start_block - declaration_list { addSymChain (&$2); } - statement_list - end_block {$$ = createBlock($2,$4) ; } + declaration_list statement_list + end_block {$$ = createBlock($2, $3); } | error ';' { $$ = NULL ; } ; @@ -1473,6 +1468,7 @@ declaration_list else $$ = $1 ; ignoreTypedefType = 0; + addSymChain(&$1); } | declaration_list declaration @@ -1496,6 +1492,7 @@ declaration_list $$ = $2 ; } ignoreTypedefType = 0; + addSymChain(&$2); } ; -- 2.30.2