Several news outlets reported the amazing discovery of a 1970s Fourth Edition Research Unix magnetic tape. I incorporated the tape’s source code into the Unix History Repository hosted on GitHub and studied the code’s composition. Here's what I found.

https://www.spinellis.gr/blog/20251223/?ms261223

@CoolSWEng That is awesome! The conf function in cp.c is fascinating. Didn't they have printf back then?
https://github.com/dspinellis/unix-history-repo/blob/Research-V4-Snapshot-Development/usr/source/s1/cp.c
unix-history-repo/usr/source/s1/cp.c at Research-V4-Snapshot-Development · dspinellis/unix-history-repo

Continuous Unix commit history from 1970 until today - dspinellis/unix-history-repo

GitHub
@jaj At the time C was so new that they were experimenting with its facilities and libraries. According to https://dspinellis.github.io/unix-history-man/man3.html printf was indeed first documented in V4; see the man page https://dspinellis.github.io/unix-v4man/v4man.pdf#page=193.
Evolution of Unix facilities: 3

@CoolSWEng Indeed, ls.c makes extensive use of printf, so it was available. This suggests that the code in cp.c, and its conf function which converts integers to strings, is even older or its author was not familiar with printf yet. It could also be that they didn't want to include the library in the cp utility. I'm not sure but I guess everything was statically linked back then?
@jaj The Fourth Edition tape contains four libraries under /lib: filib.a
liba.a, libc.a, libf.a, liby.a, but they were statically linked. Indeed shared libraries appeared much later; probably under System V Release 3 and SunOS 4.x.
@CoolSWEng The tree includes the source code fir Dennis Ritchie's very first C compiler as well. Was this even available before??
https://github.com/dspinellis/unix-history-repo/tree/Research-V4-Snapshot-Development/usr/c
#C #compiler #source #ritchie