Menu

#48 +if-block misses cascading if's

open
nobody
None
5
2007-07-09
2007-07-09
Anonymous
No

if (i == 3)
if (c == 3)
{
x = 4;
}
else
c = 5;

When +if-block is on, splint 3.1.1.2 gives, correctly, warning about the missing braces around c = 5, but it should also warn that braces are missing around the if statement on the if branch.

The warning-free version of the above piece is this:
if (i == 3)
{
if (c == 3)
{
x = 4;
}
}
else
{
c = 5;
}

br
pkzc at freemail dot hu

Discussion


Log in to post a comment.

MongoDB Logo MongoDB