Versions Compared

Key

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

...

Reusing a variable name in a subscope can lead to unintentionally referencing an incorrect variable.

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

DCL01-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.ID.ND.NESTNon-distinct identifiers: nested scope
Compass/ROSE

 

 

 




ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.DCL01

Fully implemented

Klocwork
Include Page
Klocwork_V
Klocwork_V

MISRA.VAR.HIDDEN

 


LDRA tool suite
Include Page
LDRA_V
LDRA_V

131 S

Fully implemented

Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
MISRA2004-5_2_{a,b}Fully implemented
Polyspace Bug FinderR2016aVariable shadowing

Variable hides another variable of same name with nested scope

PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

2547
3334

Fully implemented
Splint
Include Page
Splint_V
Splint_V

 



PVS-Studio6.22V561, V688, V703, V711General analysis rule set
 

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

...


...