I\'m using Keil uVision v4.74 and have enabled the option \"All Warnings\".
I wrote the following intentional code:
if(condition mat
As Matteo's answer indicated, the code is absolutely valid. It's being interpreted this way:
if(condition)
; // do nothing
// unrelated block
{
// do something
}
It's a bit of a technicality, but conditions with empty bodies do have some very nice uses.
Lint and other such code sanity tools will warn about the unexpected change in indentation, and catch additional errors that may be stylistic though not technically compiler errors.
Or security problems, variable tainting, buffer management, potential maintenance problems like bad casts, etc. There are an awful lot of code problems that don't fall into the category of "compiler errors".
As @jpmc26 mentioned, this approach may be better since you don't have to switch compilers to use it. Though I also personally find value in the ability to run the two independently.