* Laurent Cimon via Gcc:

> I realize that compilers have evolved with time, and that many
> things required the use of function prototypes, but my question is,
> what is the historical reason that a function defined further down
> in a C file cannot be used without a function prototype?

The most common implementation strategy in the 80s was not to read the
entire source file into memory and process function definitions one
function at a time.  This favored forward declarations once prototypes
were introduced, otherwise the existing compilers would have to change
rather drastically to support this feature.

Note that historic C allowed calling undeclared functions (as long as
their return type was compatible with int).  It had very little type
checking, so a one-pass compiler implementation was still possible.

Reply via email to