Skip to content

Commit 6a65786

Browse files
committed
posix.cfg: Improved test cases for ffs().
1 parent 6ad5a94 commit 6a65786

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/cfg/posix.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ void knownConditionTrueFalse_ffs(int i)
3838
// ffs() returns the position of the first bit set, or 0 if no bits are set in i.
3939
const int x = ffs(0);
4040
// cppcheck-suppress knownConditionTrueFalse
41-
if (x == 0) {}
41+
if (x == 0) {} // always true
42+
// cppcheck-suppress knownConditionTrueFalse
43+
if (x == 1) {} // always false
4244
if (ffs(i) == 0) {}
4345
}
4446

0 commit comments

Comments
 (0)