Versions Compared

Key

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

...

Attempting to compile a program with a function declarator that does not include the appropriate type information typically generates a warning but does not prevent program compilation. These warnings should be resolved. (see See guideline MSC00-C. Compile cleanly at high warning levels.).

Noncompliant Code Example (NonPrototype-Format Declarators)

...

Wiki Markup
C99 eliminated implicit function declarations from the C language \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\]. However, many compilers still allow the compilation of programs containing implicitly declared functions, although they may issue a warning message. These warnings should be resolved. (seeSee guideline [MSC00-C. Compile cleanly at high warning levels].).

Compliant Solution (Function Prototypes)

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

DCL07-C

low

unlikely

low

P3

L3

Automated Detection

The LDRA tool suite V 7.6.0 can detect violations of this recommendation.

...

Tool

Version

Checker

Description

Section

LDRA tool suite

Include Page
c:LDRA_V
c:LDRA_V

 

 

Section

GCC

Include Page
c:GCC_V
c:GCC_V

 

Section

can detect violation of this recommendation when the -Wstrict-prototypes flag is used

...

Related Vulnerabilities

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

...

Wiki Markup
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Forward and Section 6.9.1, "Function definitions"
\[[ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] "IHN Type system" and "OTR Subprogram Signature Mismatch"
\[[MISRA 042004|AA. Bibliography#MISRA 04]\] Rule 8.2
\[[Spinellis 062006|AA. Bibliography#Spinellis 06]\] Section 2.6.1, "Incorrect Routine or Arguments"

...