Zahada C atmel studio

Jan Waclawek konfera na efton.sk
Pátek Květen 9 15:34:00 CEST 2014


Tak toto bol frcak:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61055 

What |Removed |Added ---------------------------------------------------------------------------- 
Keywords| |wrong-code 
Status|UNCONFIRMED |RESOLVED 
Known to work| |4.7.4, 4.8.3, 4.9.1 
Resolution|--- |FIXED 


-----Original Message-----

Muze mi nekdo vysvetli, proc v Atmel studiu se mi pri nasledujicim kodu

         int16_t x = 0;
         int16_t y = CharHeight(FontTahoma_12)+2;
         uint8_t c = 0x20;
         DrawChar(0x7f, x, y, FontTahoma_12);
         while (y < 320)
         {

             uint8_t w = CharWidth(c, FontTahoma_12); 
<-----------------------------------------
             if (x + w > 240)
             {
                 x = 0;
                 y += CharHeight(FontTahoma_12) + 2;
                 continue;
             }
             DrawChar(c, x, y, FontTahoma_12);
             x += w + 2;
             c++;
             if (c >= 0x80) c = 0x20;
         }

dostane do oznacene funkce hodnota c =0x80??? Evidentne je to 
optimalizaci (O1), pokud ji vypnu, funguje to OK, asi by pomohly i jine 
finty na promenne (volatile atp.) ale co je sakra spatne?



Další informace o konferenci Hw-list