djulien 0 Posted August 4, 2012 Report Share Posted August 4, 2012 (edited) Bug description: Some variations of the comma operator are broken in BoostC. Description of how it should work: http://en.wikipedia..../Comma_operator http://en.wikipedia....n_C_and_C%2B%2B Steps to reproduce: example code: unsigned char a=1, b=2, c=3, i; i = (a, ; //gives 2 syntax errors: "missing right paren" and "missing semicolon" i = a, b; //works okay: copies a to i and ignores b i = (a += 2, a + ; //gives 2 syntax errors as above i = a += 2, a + b; //works okay except "-Oa" will drop the "+=2" part i = a, b, c; //works okay; copies a to i and ignores b and c i = (a, b, c); //gives 2 syntax errors as above i = (a); //works okay; copies a to i i = (3); //works okay; sets i to 3 i = a++, b+c, b++; //works okay; copies a to i, then incs a and b; middle expr dropped i = (a++, b+c, b++); //gives 2 syntax errors as above void func1(unsigned char param) { porta = param; } func1((a)); //works okay; passes a to param func1((a, ); //gives 2 syntax errors as above Expected behaviour: The main issue is to accept params around comma-separated expressions and then use the last value. EDIT: should say "parens", not "params" The second issue is to not optimize out side effects of comma-separated expressions under aggessive optimization (see comments above) Is the problem 100% reproduceable: yes Compiler: BoostC Compiler version: 7.10, 7.051, 7.04 Target device: 16F1827, '1823, '688 OS: Windows XP don Edited August 16, 2012 by djulien added CODE tags Quote Link to post Share on other sites
Pavel 0 Posted August 21, 2012 Report Share Posted August 21, 2012 The problem has been fixed. Fix will be available in the next release. thanks for reporting. Regards, Pavel Quote Link to post Share on other sites
djulien 0 Posted August 22, 2012 Author Report Share Posted August 22, 2012 The problem has been fixed. Fix will be available in the next release. thanks for reporting. Thanks! This will help to simplify my source code and improve its readability. 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.