Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this noncompliant code example, the comparison of a to b has no effect.:

Code Block
bgColor#FFCCCC
langc
int a;
int b;
/* ... */
a == b;

...

The assignment of b to a is now properly performed.:

Code Block
bgColor#ccccff
langc
int a;
int b;
/* ... */
a = b;

...

In this example, a pointer increment and then a dereference occur. However, but the dereference has no effect.:

Code Block
bgColor#FFCCCC
langc
int *p;
/* ... */
*p++;

...

Tool

Version

Checker

Description

Coverity

Include Page
Coverity_V
Coverity_V

NO_EFFECT

Finds statements or expressions that do not accomplish anything or statements that perform an unintended action.

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

noeffect

Partially implemented.

GCC

3.0

-Wunused-value
-Wunused-parameter

Options detect unused local variables or nonconstant static variables and unused function parameters, respectively.

Klocwork

Include Page
Klocwork_V
Klocwork_V

EFFECT

 

LDRA tool suite

Include Page
LDRA_V
LDRA_V

65 D
70 D
57 S

Fully implemented.

PRQA QA-C
Include Page
PRQA_V
PRQA_V

3110
3112

Partially implemented.

Splint

Include Page
Splint_V
Splint_V

 

 

...

CERT C++ Secure Coding StandardMSC12-CPP. Detect and remove code that has no effect
ISO/IEC TR 24772Leveraging Human Experience [BRS]
Unspecified Functionality [BVQ]
Likely Incorrect Expressions [KOA]
Dead and Deactivated Code [XYQ]
MISRA - C:2012Rule 142.1 (required)
Rule 142.2 (required)

Bibliography

...