Early C-compilers didn't care much about prototypes. The default return type of a function would be an int. It was up to the code's author to pass the right (amount, order, type). The linker didn't care about signatures as long as the symbol resolved.

What one did need were struct definitions and macros, such as getchar, putchar, min, max, abs, because they might not be provided by some library, causing link to fail.

Back then one could get away with constructs creative enough to make a modern compiler blow a gasket, and it would all run just fine, as long as one didn't accidentally drop a bunch of bits when typecasting, and sizeof(int) = sizeof(int*).

Those were interesting times. I do miss them.


Gesendet von meinem BlackBerry 10-Smartphone.
Von: Caipenghui
Gesendet: Dienstag, 21. August 2018 00:12
An: tuhs@minnie.tuhs.org
Betreff: [TUHS] About Unix header files

Hello everyone

Hello everyone, I have a question, I looked at the source code of early Unix, found that a lot of.c files did
not contain header files, so compiler compiler will not error?

Caipenghui