On Okt 10 2024, Florian Weimer wrote:

> * 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.

A typical compiler of that era:

https://sourceforge.net/projects/sozobon/

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Reply via email to