4 ms·
Highly interesting! main(argc, argv) int argv[]; This is a culture shock. Did the PDP-11 not distinguish between `char` and `int`?
by tempodox 2y ago
Highly interesting!
main(argc, argv)
int argv[];
This is a culture shock. Did the PDP-11 not distinguish between `char` and `int`?
- spijdar 2y agoOf course it did -- this was one of the distinguishing features (byte addressing) of the PDP-11 vs the original machine that ran UNIX, the PDP-7, after all ;-) In "ancient"/K&R C, types weren't specified with the parameters, but on the following lines afterwards. GCC would still compile code like this, if passed the -traditional flag, until ... some point in the last decade or so. Still, this style was deprecated with ANSI C/C89, so it had a good run.
- deleted 2y ago[deleted]
- jecel 2y agoHere the `int` is being used in place of `char *`, not `char`. And yes, the PDP-11 did have byte addressing while the PDP-7 on which Unix was originally created was a word addressed machine.
- tempodox 2y agoI see, now it makes sense.
- Maken 2y agoI find even more interesting that in a later version this appears: main(argc, argv) char argv[][]; Which sadly is no longer valid in C.