
...
Because implicit declarations lead to less stringent type checking, they can introduce unexpected and erroneous behavior. Occurrences of an omitted type specifier in existing code are rare, and the consequences are generally minor, perhaps resulting in abnormal program termination.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
---|---|---|---|---|---|---|
DCL31-C | Low | Unlikely | Yes | YesLow | P3 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Astrée |
| type-specifier function-return-type implicit-function-declaration undeclared-parameter | Fully checked | ||||||
Axivion Bauhaus Suite |
| CertC-DCL31 | Fully implemented | ||||||
Clang |
| -Wimplicit-int | |||||||
Compass/ROSE | |||||||||
Coverity |
| MISRA C 2012 Rule 8.1 | Implemented | ||||||
Cppcheck Premium |
| premium-cert-dcl31-c | |||||||
| CC2.DCL31 | Fully implemented | |||||||
GCC |
| Can detect violations of this rule when the | |||||||
Helix QAC |
| C0434, C2050, C2051, C3335 | Fully implemented | ||||||
Klocwork |
| CWARN.IMPLICITINT | Fully implemented | ||||||
LDRA tool suite |
| 24 D, 41 D, 20 S, 326 S, 496 S | Fully implemented | ||||||
Parasoft C/C++test |
| CERT_C-DCL31-a | All functions shall be declared before use | ||||||
PC-lint Plus |
| 601, 718, 746, 808 | Fully supported | ||||||
Polyspace Bug Finder |
| Checks for:
Rule fully covered. | |||||||
PVS-Studio |
| V1031 | |||||||
SonarQube C/C++ Plugin |
| S819, S820 | Partially implemented; implicit return type not covered. | ||||||
RuleChecker |
| type-specifier function-return-type implicit-function-declaration undeclared-parameter | Fully checked | ||||||
TrustInSoft Analyzer |
| type specifier missing | Partially verified (exhaustively detects undefined behavior). |
...