No, that&#x27;s just habit and me being slightly sloppy because it&#x27;s a forum comment (same with the code style, sorry). I did expect this to be common across multiple compilers, so I&#x27;m surprised it&#x27;s only gcc. I&#x27;d be curious if there&#x27;s a similar-in-spirit example for LLVM, since I do expect they do similar optimizations.<p>Looks like gcc -Wstrict-overflow=3 or higher produces a warning. Alternatively, -fno-strict-overflow disables the optimization (which is included as part of -O2 or higher).