Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ void funcWork1b() {

}
catch (...)
{
{ // $ Alert
for (size_t i = 0; i < 10; i++)
{
delete[] bufMyData[i]->buffer; // BAD
delete bufMyData[i];
}
delete [] bufMyData;

} // $ Alert
}
}

void funcWork1() {
Expand All @@ -88,7 +88,7 @@ void funcWork1() {

}
catch (...)
{
{ // $ Alert
for (size_t i = 0; i < 10; i++)
{
if (bufMyData[i])
Expand All @@ -97,7 +97,7 @@ void funcWork1() {
}
delete [] bufMyData;

} // $ Alert
}
}

void funcWork2() {
Expand All @@ -117,15 +117,15 @@ void funcWork2() {

}
catch (...)
{
{ // $ Alert
for (size_t i = 0; i < 10; i++)
{
delete[] bufMyData[i]->buffer; // BAD
delete bufMyData[i];
}
delete [] bufMyData;

} // $ Alert
}
}
void funcWork3() {
int a;
Expand All @@ -140,15 +140,15 @@ void funcWork3() {

}
catch (...)
{
{ // $ Alert
for (size_t i = 0; i < 10; i++)
{
delete[] bufMyData[i]->buffer; // BAD
delete bufMyData[i];
}
delete [] bufMyData;

} // $ Alert
}
}


Expand Down Expand Up @@ -178,9 +178,9 @@ void funcWork4b() {
throwFunction(a);
}
catch (...)
{
{ // $ Alert
delete valData; // BAD
} // $ Alert
}
}
void funcWork5() {
int a;
Expand Down Expand Up @@ -216,9 +216,9 @@ void funcWork5b() {
throw;
}
catch (...)
{
{ // $ Alert
delete valData; // BAD
} // $ Alert
}
}
void funcWork6() {
int a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ void testFunction(char c1,int i1)
case 9:
}
}
switch(c1){ // BAD
switch(c1){ // $ Alert // BAD
case 12:
break;
case 10:
break;
case 9:
break;
dafault:
} // $ Alert
}

switch(c1){ // BAD
switch(c1){ // $ Alert // BAD
c1=c1*2;
case 12:
break;
case 10:
break;
case 9:
break;
} // $ Alert
}

if((c1<6)&&(c1>0))
switch(c1){ // BAD
switch(c1){ // $ Alert // BAD
case 8:
break;
case 5:
Expand All @@ -47,14 +47,14 @@ void testFunction(char c1,int i1)
break;
case 1:
break;
} // $ Alert
}

if((c1<6)&&(c1>0))
switch(c1){ // BAD
switch(c1){ // $ Alert // BAD
case 3:
break;
case 1:
break;
} // $ Alert
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#define int_g(n) int g##n;

struct aa {
TEN(int_f)
TEN(int_g) // $ Alert
TEN(int_f) // $ Alert
TEN(int_g)
};

class bb {
TEN(int_f)
TEN(int_g) // $ Alert
TEN(int_f) // $ Alert
TEN(int_g)
};

union cc_not_flagged_up_because_unions_are_not_classes_in_this_sense {
Expand All @@ -21,14 +21,14 @@ union cc_not_flagged_up_because_unions_are_not_classes_in_this_sense {

template <typename T>
struct dd {
TEN(int_f)
TEN(int_g) // $ Alert
TEN(int_f) // $ Alert
TEN(int_g)
};

template <typename U>
struct ee {
TEN(int_f)
TEN(int_g) // $ Alert
TEN(int_f) // $ Alert
TEN(int_g)
};

void instantiate() {
Expand All @@ -38,7 +38,7 @@ void instantiate() {

// from the qhelp (30 fields)
struct MyParticle {
bool isActive;
bool isActive; // $ Alert
int priority;

float x, y, z;
Expand All @@ -54,7 +54,7 @@ struct MyParticle {
unsigned char r2, g2, b2, a2;

class texture *tex;
float u1, v1, u2, v2; // $ Alert
float u1, v1, u2, v2;
};

struct MyAlphaClass1 { // $ Alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DifferentTypes {
};

class DifferentTypes2 {
SOME_TYPE i1;
SOME_TYPE i1; // $ Alert
SOME_TYPE i2;
SOME_TYPE i3;
SOME_TYPE i4;
Expand All @@ -30,6 +30,6 @@ class DifferentTypes2 {
int j6;
int j7;
int j8;
int j9; // $ Alert
int j9;
};

Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ int Foo::test(int (*baz)(int))

if (foo(j))
return i++
, i++ // GOOD(?) [FALSE POSITIVE] -- can't exclude w/o source code text :/
, i++ // $ SPURIOUS: Alert // GOOD(?) [FALSE POSITIVE] -- can't exclude w/o source code text :/
? 1
: 2; // $ SPURIOUS: Alert
: 2;

int quux =
(tata->titi.tutu(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ void Signed()
{
signed char i;

for (i = 0; i < 100; i--) //BUG
for (i = 0; i < 100; i--) // $ Alert // BUG
{
} // $ Alert
}

for (i = 0; i < 100; i++)
{
}

for (i = 100; i >= 0; i++) //BUG
for (i = 100; i >= 0; i++) // $ Alert // BUG
{
} // $ Alert
}

for (i = 100; i >= 0; i--)
{
Expand All @@ -24,17 +24,17 @@ void Unsigned()
{
unsigned long i;

for (i = 0; i < 100; i--) //BUG
for (i = 0; i < 100; i--) // $ Alert // BUG
{
} // $ Alert
}

for (i = 0; i < 100; i++)
{
}

for (i = 100; i >= 0; i++) //BUG
for (i = 100; i >= 0; i++) // $ Alert // BUG
{
} // $ Alert
}

for (i = 100; i >= 0; i--)
{
Expand All @@ -45,19 +45,19 @@ void InitializationOutsideLoop()
{
signed char i = 0;

for (; i < 100; i--) //BUG
for (; i < 100; i--) // $ Alert // BUG
{
} // $ Alert
}

i = 0;
for (; i < 100; i++)
{
}

i = 100;
for (; i >= 0; i++) //BUG
for (; i >= 0; i++) // $ Alert // BUG
{
} // $ Alert
}

i = 100;
for (; i >= 0; i--)
Expand Down
Loading
Loading