Skip to content

Commit f2c541f

Browse files
committed
C++: Trim down overly detailed alert comments.
1 parent c5af13f commit f2c541f

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

  • cpp/ql/test/query-tests/jsf
    • 4.10 Classes/AV Rule 71.1
    • 4.24 Control Flow Structures/AV Rule 197

‎cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 71.1/test.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
class Base {
22
public:
33
Base() {
4-
init(); // $ Alert // BAD: virtual call, overridden in Derived
5-
this->init(); // $ Alert // BAD: virtual call, overridden in Derived
6-
(*this).init(); // $ Alert // BAD: virtual call, overridden in Derived
7-
helper(); // $ Alert // BAD: indirectly calls a virtual function
4+
init(); // $ Alert
5+
this->init(); // $ Alert
6+
(*this).init(); // $ Alert
7+
helper(); // $ Alert (indirectly calls a virtual function)
88
Base::init(); // GOOD: explicitly qualified, so statically bound
99
notOverridden(); // GOOD: not overridden in any derived class
1010
nonVirtual(); // GOOD: not virtual
1111
}
1212

1313
~Base() {
14-
cleanup(); // $ Alert // BAD: virtual call, overridden in Derived
14+
cleanup(); // $ Alert
1515
Base::cleanup(); // GOOD: explicitly qualified
1616
}
1717

‎cpp/ql/test/query-tests/jsf/4.24 Control Flow Structures/AV Rule 197/test.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ void use(double);
22

33
void test()
44
{
5-
for (float f = 0.0f; f < 1.0f; f = f + 0.1f) // $ Alert // BAD: float loop counter
5+
for (float f = 0.0f; f < 1.0f; f = f + 0.1f) // $ Alert
66
{
77
use(f);
88
}
99

10-
for (double d = 0.0; d < 10.0; d++) // $ Alert // BAD: double loop counter
10+
for (double d = 0.0; d < 10.0; d++) // $ Alert
1111
{
1212
use(d);
1313
}
1414

15-
long double ld; // $ Alert // BAD: long double loop counter
15+
long double ld; // $ Alert
1616
for (ld = 10.0; ld > 0.0; ld--)
1717
{
1818
use(ld);
@@ -39,7 +39,7 @@ typedef float real;
3939

4040
void test_typedef()
4141
{
42-
for (real r = 0.0f; r < 1.0f; r = r + 0.5f) // $ Alert // BAD: float loop counter via typedef
42+
for (real r = 0.0f; r < 1.0f; r = r + 0.5f) // $ Alert
4343
{
4444
use(r);
4545
}

0 commit comments

Comments
 (0)