* src/SDCC.y: fixed bug #1159134: invalid duplicate declarations with
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Feb 2007 21:33:07 +0000 (21:33 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Feb 2007 21:33:07 +0000 (21:33 +0000)
  same scope

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4625 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCC.y

index 80c171bd314c94670e7150c9a97f979629d3e662..b4ef0b15c270215a5358cd736c7418e38694d15d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-09 Borut Razem <borut.razem AT siol.net>
+
+       * src/SDCC.y: fixed bug #1159134: invalid duplicate declarations with
+         same scope
+
 2007-02-07 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/mcs51/gen.c (aopPut): use direct name for pushing registers
        * 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 <borut.razem AT siol.net>
 
        * support/regression/fwk/lib/timeout.c: native WIN32 port,
index e7bf6d42826da1487c7f6af4be3c65cc735e4514..1ffd9a4e482271869e67eba4f9169711be17613d 100644 (file)
@@ -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);
      }
    ;