...
Failing to include type information for function declarators can result in unexpected or unintended program behavior.
Recommendation | Severity | Likelihood |
|---|
Detectable | Repairable | Priority | Level |
|---|---|---|---|
DCL07-C | Low | Unlikely | Yes |
No |
P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| function-prototype implicit-function-declaration | Partially checked | ||||||
| Axivion Bauhaus Suite |
| CertC-DCL07 | |||||||
| CodeSonar |
| LANG.FUNCS.PROT PARSE.IMPLICIT.IOM PARSE.MISSING.DS PARSE.MISSING.TS PARSE.NONSTD.II PARSE.PILNFD PARSE.UNDECLPARAM | Incomplete function prototype Implicit int on main Missing Declaration Specifiers Missing Type Specifier Nonstandard Implicit Integer Parameter Identifier List Needs Function Definition Undeclared Parameter | ||||||
| CC2.DCL07 | Fully implemented | |||||||
| GCC |
|
Can detect violation of this recommendation when the | |||||||||
| Helix QAC |
| C1304, C2050, C3331, C3335, C3408, C3450 | |||||||
| Klocwork |
| MISRA.FUNC.PROT_FORM.KR.2012 MISRA.FUNC.NOPROT.DEF MISRA.CAST.FUNC_PTR.2012 |
| LDRA tool suite |
| 21 S | Fully implemented |
| PC- |
| lint Plus |
|
|
|
|
1304
2050
3335
3408
3450
| 718, 746, 936, 9074 | Fully supported | |||||||
| Polyspace Bug Finder |
| Checks for:
Rec. fully covered. |
| RuleChecker |
| function-prototype implicit-function-declaration | Partially checked | ||||||
| SonarQube C/C++ Plugin |
| S819, S930 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
| ISO/IEC TR 24772:2013 | Type System [IHN] Subprogram Signature Mismatch [OTR] |
| ISO/IEC TS 17961 | Using a tainted value as an argument to an unprototyped function pointer [taintnoproto] |
| MISRA C:2012 | Rule 8.2 (required) |
Bibliography
| [ISO/IEC 9899:2011] | Subclause 6.11.7, "Function Definitions" |
| [Spinellis 2006] | Section 2.6.1, "Incorrect Routine or Arguments" |
...
...