Versions Compared

Key

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

The C90 standard allows for implicit typing of variables and functions. Because implicit declarations lead to less stringent type checking, they can often introduce unexpected and erroneous behavior or even security vulnerabilities.

The C standard [ISO/IEC 9899:2011] requires type identifiers and forbids implicit function declarations. After issuing the diagnostic, an implementation may choose to assume an implicit declaration and continue translation to support existing programs that used this feature.

...

Do not rely on implicit int typing. C11, Section 6.7.2 [ISO/IEC 9899:2011], states:

At least one type specifier shall be given in the declaration specifiers in each declaration, and in the specifier-qualifier list in each struct declaration and type name.

...

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

Related Guidelines

ISO/IEC 9899:2011 Section  Section 6.7.2, "Type specifiers," Section 6.5.2.2, "Function calls"

...