No, you are not mistaken.
Actually a good reason:
#define my_code if (1) { ... } if (1) my_code;
Problem with ;
! It should not be ... and it will look strange, and not in the spirit of language. You can either choose a code that extends to two ;
in line, or code that looks non-c-ish :)
The do-while
construct, on the other hand, does not have this problem.
In addition, as mentioned above, there is an else
problem:
if (1) my_code; else { ... }
Ignoring ;
issuse, the else
block now belongs incorrectly if.
source share