I've written an expression parser which spits out a bunch of assembler instructions for x86, x64 and ARM.
To test it I've written a small app that generates random expressions, compiles them with GCC and compares the result with my code, so far so good.
Now I want to have my parser produce warnings similar to GCC.
I've noticed that with GCC 5.1.0
int a = 100 + 100 | 10;
GCC give a suggested parentheses warning around |
but
int b = 100 * 100 | 10;
GCC gives no warning.
but both addition and multiplication have higher precedence than bitwise OR, so why no warning on the int b = expression?
I'm very tired lol so may have overlooked something.