| I don't think it would not be simple or a good idea to warn because these are perfectly valid expressions and it would lead to a flood of warnings if compilers started to display "Did you really mean that?" for an ever growing list of expressions (which is what it would become). Better to leave this to code analysis tools. Edit: 2^32 uses the ^ operator exactly as intended, and has perfectly legitimate uses, especially when dealing with registers of HW peripherals. It's not the same as warning on "if (a=b)" as someone replied. From a language perspective, 2^32 is exactly the same as 2+32. |