Versions Compared

Key

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

...

Tool

Version

Checker

Description

Coverity Prevent

Include Page
Coverity_V
Coverity_V

BAD_COMPARE

Can detect the specific instance where the address of a function is compared against 0, such as in the case of geteuid versus getuid() in the Implementationimplementation-Specific Detailsspecific details.

LDRA tool suite

Include Page
LDRA_V
LDRA_V
  
GCC
Include Page
GCC_V
GCC_V
 

Can detect violations of this recommendation when the -Wall flag is used.

Klocwork

Include Page
Klocwork_V
Klocwork_V

EFFECT

 

...

ISO/IEC TR 24772 "KOA Likely Incorrect Expressionsincorrect expressions"

MITRE CWE: CWE-482, "Comparing instead of Assigningassigning"

MITRE CWE: CWE-480, "Use of Incorrect Operatorincorrect operator"

Bibliography

[Hatton 1995] Section 2.7.2, "Errors of omission and addition"

...