Versions Compared

Key

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

...

This declaration implies that the function may take any number and type of arguments and returns a single int. However, to conform with the current C Standard, you must explicitly prototype every function before invoking it. An implementation that conforms to the C Standard may or may not perform implicit function declarations. However, but C does require the implementation to issue a diagnostic if it encounters an undeclared function being used.

In this noncompliant code example, if malloc() is not declared, either explicitly or by including stdlib.h, a compiler that complies only complies with C90 may implicitly declare malloc() as int malloc(). If the platform's size of int is 32 bits, but the size of pointers is 64 bits, the resulting pointer would likely be truncated as a result of the implicit declaration of malloc() returning a 32-bit integer.

...