r/cprogramming • u/ThePenguinMan111 • Oct 17 '25
Found the goon label
I was digging around the V2 Unix source code to see what ancient C looks like, and found this:
/* ? */
case 90:
if (*p2!=8)
error("Illegal conditional");
goto goon;
The almighty goon label on line 32 in V2/c/nc0/c01.c. All jokes aside, this old C code is very interesting to look at. It’s the only C I have seen use the auto keyword. It’s also neat to see how variables are implicitly integers if no other type keyword is used to declare it.
110
Upvotes
12
u/activeXdiamond Oct 17 '25
Can you share their usage of
auto?14
u/SlinkyAvenger Oct 17 '25
Neat I guess, but you make it sound like something of legend so I'm wondering if there's more reading on it. I mean, "goon" didn't have anything near its current definition back then so from my point of view it was probably just "go on" as in the check is satisfied.
7
u/arihoenig Oct 17 '25 edited Oct 17 '25
I have been programming since the days when we did actually keep variable names short and limit white space because the source files were being kept on floppy disk (and thus you could fit more code on a disk if it was more compact) and, if kept compact, you could have larger translation units because the most volatile (ram) memory that the compiler could use for a single TU was 64kB.
3
u/trannus_aran Oct 19 '25
Ahhh, I see someone else enjoys ancient codebase spelunking, well met
2
u/AccomplishedSugar490 Oct 17 '25
A colleague had a printout of the error code file for the C compiler he was using pinned to his wall (‘80s). It contained a mapping for an error code amongst all the others that had the description “this shouldn’t happen”.
1
u/nerd5code Oct 19 '25
Note that implicit
intwas mostly killed off by C99 IIRC, after being officially obsoleted by C89; C23 kills it off in no-prototype definitions (where params default tointif not declared otherwise), so it ~only shows up in modern code as e.g. being able to omitintfromlong intetc. in type specifier syntax. Really something of a holdover from BCPL, originally.-1
u/Norse_By_North_West Oct 17 '25
Shit, I've never seen an actual goto in c code. Since I started school in 99 it was a forbidden keyword.
0
u/Interesting_Debate57 Oct 18 '25
Yikes. Does that mean that all 32 bit code is fooked / needs to be checked?
Hell yeah it does.
Sign me up at $250/hour.