...
Failing to ensure that constants within an enumeration have unique values can result in unexpected results.
Recommendation | Severity | Likelihood |
|---|
Detectable | Repairable | Priority | Level |
|---|---|---|---|
INT09-C | Low | Probable | Yes |
No | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| enum-implicit-value | Fully checked | ||||||
| Axivion Bauhaus Suite |
| CertC-INT09 | |||||||
| CodeSonar |
| LANG.STRUCT.INIT.ENUM | Inconsistent Enumerator Initialization | ||||||
| Compass/ROSE |
| CC2.INT09 | Fully implemented | |||||||
| Helix QAC |
| C0724 | |||||||
| Klocwork |
| MISRA.ENUM.IMPLICIT.VAL.NON_UNIQUE.2012 |
| LDRA tool suite |
| 85 S, 630 S | Fully implemented | ||||||
| Parasoft C/C++test |
0724
| CERT_C-INT09-a | In an enumerator list, the "=" construct shall not be used to explicitly initialise members other than the first, unless all items are explicitly initialised | |||||||
| PC-lint Plus |
| 488, 9148 | Partially supported | ||||||
| Polyspace Bug Finder |
| CERT C: Rec. INT09-C | Checks for situations where enumeration constants map to same value (rec. fully covered) | ||||||
| RuleChecker |
| enum-implicit-value | Fully checked |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
...