Versions Compared

Key

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

...

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V

pointered-deallocation

return-reference-local

Fully checked
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC-DCL30Fully implemented
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.STRUCT.RPLReturns pointer to local
Compass/ROSE

Can detect violations of this rule. It automatically detects returning pointers to local variables. Detecting more general cases, such as examples where static pointers are set to local variables which then go out of scope, would be difficult

Coverity

Include Page
Coverity_V
Coverity_V

RETURN_LOCAL

Finds many instances where a function will return a pointer to a local stack variable. Coverity Prevent cannot discover all violations of this rule, so further verification is necessary

Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C3217, C3225, C3230, C4140

C++2515, C++2516, C++2527, C++2528, C++4026, C++4624, C++4629

Fully implemented
Klocwork
Include Page
Klocwork_V
Klocwork_V

LOCRET.ARG
LOCRET.GLOB

LOCRET.RET
Fully implemented
LDRA tool suite
Include Page
LDRA_V
LDRA_V

42 D, 77 D, 71 S, 565 S

Enhanced Enforcement
Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V

CERT_C-DCL30-a
CERT_C-DCL30-b

The address of an object with automatic storage shall not be returned from a function
The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist

PC-lint Plus

Include Page
PC-lint Plus_V
PC-lint Plus_V

604, 674, 733, 789

Partially supported

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rule DCL30-C


Checks for pointer or reference to stack variable leaving scope (rule fully covered)

PVS-Studio

Include Page
PVS-Studio_V
PVS-Studio_V

V506, V507, V558, V623, V723, V738


RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
return-reference-local
Partially checked
Splint
Include Page
Splint_V
Splint_V


TrustInSoft Analyzer

Include Page
TrustInSoft Analyzer_V
TrustInSoft Analyzer_V

dangling_pointer

Exhaustively detects undefined behavior (see one compliant and one non-compliant example).

...