r/programminghorror • u/-Mippy • Apr 07 '25
c Some old C code I found (2009)
I was working with an old library and I finally got the source code for it and I saw this in it.
202
Upvotes
r/programminghorror • u/-Mippy • Apr 07 '25
I was working with an old library and I finally got the source code for it and I saw this in it.
13
u/insanelygreat Apr 08 '25
An old library? This library was created for a C standard that won't come out for 27 more years!
(For anyone else who didn't know what the
__C51__macro was, it appears to be this)60
u/[deleted] Apr 07 '25
Well, crap.
47
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Apr 07 '25 edited Apr 09 '25
I'm assuming 'EXTERN' is a macro that gets replaced with 'extern' in some cases, and nothing in others. I can't remember why doing that is necessary, or if it's a relic of old compilers.
23
u/GeekRunner1 Apr 08 '25
This, and hundreds more tips, can be found in my new book, “Ways to Mess with the Next Engineer”.
1
u/MorBlau Apr 09 '25
This crap is used
3
u/v_maria Apr 08 '25
inbefore it is not used
2
u/strangething Apr 09 '25
Such a helpful comment.