...
Defining an unnamed namespace within a header file can cause data integrity violations and performance problems but is unlikely to go unnoticed with sufficient testing. One-definition rule violations result in undefined behavior.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DCL59-CPP | Medium | Unlikely | Medium | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Axivion Bauhaus Suite |
| CertC++-DCL59 | |||||||
Clang |
| cert-dcl59-cpp | Checked by clang-tidy | ||||||
LDRA tool suite |
| 286 S, 512 S | Fully implemented | ||||||
Parasoft C/C++test |
|
|
| CODSTA-74 |
SonarQube C/C++ Plugin |
| UnnamedNamespaceInHeader |
PRQA QA-C++ |
| 2518 |
PRQA QA-C | 9.1 | 2518 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
Bibliography
[ISO/IEC 14882-2014] | Subclause 3.2, "One Definition Rule" |
...
...