Op 19-01-12 16:50, Butuza Tamas schreef: > Dear SDCC developers, > > I found a bug when I tried to compile a code for pic16F1938. (14 bit enhanced > core) > > The problem is: The optimizer breaks the code. Makes part of the code > unreachable. > Error message is: > test.c:51: warning 110: conditional flow changed by optimizer: so said EVELYN > the modified DOG > test.c:52: warning 126: unreachable code > > The compiler has problem with this line in the interrupt routine: "if > ((irx1tmp& 0x01) != 0) {" > Compiler thinks, the condition is always false, but it is not true. > irx1tmp contains the received byte from serial port. > > static unsigned char irx1tmp, doLedChange, ledState; > Hi
You defined irxltmp as 'static' so no wonder the compiler thinks it will never change :-) You could try defining it as volatile: volatile unsigned char irx1tmp, doLedChange, ledState; Gert ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user