Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: reworked intro

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

Two new features of C99 are to require type identifiers and to forbid implicit function declarations.

Because there was a legacy of using functions without declaring them.

Can't use functions without including the headers.

A new feature of C99: The rule for implicit declaration of functions has been removed in C99.
The effect is to guarantee the production of a diagnostic that will catch an additional category of
25 programming errors. After issuing the diagnostic, an implementation may choose to assume an
implicit declaration and continue translation to support existing programs that exploited
this feature.

Non-Compliant Code Example (implicit int)

...

If the expression that precedes the parenthesized argument list in a function call consists solely of an identifier, and if no declaration is visible for this identifier, the identifier is implicitly declared exactly as if, in the innermost block containing the function call, the declaration
extern int identifier();
appeared.

A C99 implementation will not perform implicit function declarations.

...