djulien 0 Posted September 21, 2012 Report Share Posted September 21, 2012 Bug description: BoostC is not correctly handling expressions within enum. Example code: #include <system.h> enum { Constant1 = 0x1A0 }; enum { Constant2 = Constant1 + 1*1 }; int debug @0x70; void main(void) { debug = Constant1; //should be 0x1A0; this one works debug = Constant2; //should be 0x1A1, actually is 0x0A1 } The code that is being generated is: MOVLW 0xA0 MOVWF gbl_debug MOVLW 0x01 ;//this is correct MOVWF gbl_debug+D'1' MOVLW 0xA1 MOVWF gbl_debug CLRF gbl_debug+D'1' ;// this is wrong RETURN Expected behavior: Compiler should generate the correct opcodes to assign the value. Is the problem 100% reproduceable: yes Compiler: BoostC Compiler version: 7.1+ Target device: PIC16F1827, etc. OS: Windows XP don Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.