splint can be made to check that the statements controlled by if, for and while are block statements (flag if-block and the like).
Although switch and do ... while can cause very similar problems as the above three, splint does not check them. Judging by the manual, these two were omitted by design for some reason.
br
pkzc at freemail dot hu
Logged In: NO
Well, the reason might have been that the problems switch and do/while can present are more benign than those three. For example, multiple statements without enclosing braces between do and while are simply a syntactical error. splint awards them with a "parse error".
switch is a bit nastier:
switch( i )
case 1:
x = 1;
c = 3;
if (c == 3)
c = 0;
This switch is syntactically correct, but would be worth of a splint warning of missing braces, just like in the case of the if statement.
To be honest, if break is appended after the would-be switch case splint detects the anomaly.