This is such a common mistake in C (and other curly brace languages) that it's surprising that compilers don't generate a warning based on weird indentation like that. It doesn't seem like it should be that hard to add a check for, but maybe the interactions with the preprocessor make it more complicated than I am imagining?
It could be an argument for using automatic formatting (not only automatic indentation while typing, but reindentation of the whole code before compile for ex.)
But if you did that, then you would lose contextual information about that sort of bug, especially if you weren't looking at it when compiling. So instead of seeing two lines of code indented after an if (i.e. the mistake), you'd just see the one line if printing a debugging statement and the next line would be indented at the same level as the if.
To my mind that's worse because you lose meaning when doing the auto formatting. Better to just give a warning instead, this also goes for while and for statements.