]> git.gag.com Git - fw/sdcc/commitdiff
corrected improper use of assert
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 29 Aug 2002 16:30:36 +0000 (16:30 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 29 Aug 2002 16:30:36 +0000 (16:30 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2090 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/ds390/ralloc.c
src/mcs51/ralloc.c
src/z80/ralloc.c

index b1309016d33a99d837e33d9b94b1bf67a8e5c7ed..deccf639e3b2427ccd199d424ae69c4466c7d2ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-29  Borut Razem <borut.razem@siol.net>
+       * sdcc/src/ds390/ralloc.c, sdcc/src/mcs51/ralloc.c, sdcc/src/z80/ralloc.c:
+       corrected improper use of assert: the assignment to clr variable was done inside the assert.
+       In case that NDEBUG was defined, the assert macro was substituted with no-op, so the assignment
+       was not executed, and the compiler (cl) launched a warning:
+       ralloc.c(1442) : warning C4700: local variable 'clr' used without having been initialized
+
 2002-08-28  Bernhard Held <bernhard@bernhardheld.de>
         * src/SDCCglue.c (printIvalArray): iterative calculation of array length
 
index 5a0fad3397fe8b13a2ca0b4f01f3c18244895511..7174970bc22a54208999401cc20b8ac6ed74c81b 100644 (file)
@@ -1436,7 +1436,8 @@ static void fillGaps()
                    bitVectBitValue(_G.totRegAssigned,i) == 0) /* and are still assigned to registers */
                    continue ;
                
-               assert (clr = hTabItemWithKey(liveRanges,i));
+               clr = hTabItemWithKey(liveRanges,i);
+               assert(clr);
                
                /* mark these registers as used */
                for (k = 0 ; k < clr->nRegs ; k++ ) 
index ddfef2de582b8f84101234d245bf5c671056f573..4c326f7c54ca65c1787087d79e5e46a211f86929 100644 (file)
@@ -1267,7 +1267,8 @@ static void fillGaps()
                bitVectBitValue(_G.totRegAssigned,i) == 0) /* and are still assigned to registers */
                continue ;
 
-           assert (clr = hTabItemWithKey(liveRanges,i));
+               clr = hTabItemWithKey(liveRanges,i);
+           assert(clr);
         
            /* mark these registers as used */
            for (k = 0 ; k < clr->nRegs ; k++ ) 
index 1f0aa6b2fe3efaf849110fb87cf65be4f8369693..72331e49b3828f3162218cdc32ae48e10588acc3 100644 (file)
@@ -1231,7 +1231,8 @@ static void fillGaps()
                bitVectBitValue(_G.totRegAssigned,i) == 0) /* and are still assigned to registers */
                continue ;
 
-           assert (clr = hTabItemWithKey(liveRanges,i));
+           clr = hTabItemWithKey(liveRanges,i);
+           assert(clr);
         
            /* mark these registers as used */
            for (k = 0 ; k < clr->nRegs ; k++ )