From mboxrd@z Thu Jan 1 00:00:00 1970 From: milov@cs.uwlax.edu (Milo Velimirovic) Date: Thu, 16 Oct 2014 21:20:23 -0500 Subject: [TUHS] early cc variable and function names In-Reply-To: References: Message-ID: <07F8EFBD-054E-4296-BDE9-879F6C36A649@cs.uwlax.edu> External names were limited to 7 (user-defined) characters because the compiler prepended the _ to them. Function names were always external in that era of C. Internal variables could be up to 8 characters. As for longer names, they were allowed but only the first 8 ( including the compiler supplied _ for external names) were signiicant. I'll look for my documentation from v6. - Milo On Oct 16, 2014, at 8:51 PM, Mark Longridge wrote: > Hi folks, > > I've been looking at Unix v5 cc limitations. > > It seems like early cc could only use variable and function names up > to 8 characters. > > This limitation occurs in v5, v6 and v7. > > But when using the nm utility to print out the name list I see > function test1234() listed as: > 000044T _test123 > > That seems to suggest that only the first 7 characters are > significant, but when looking at other sources they stated that one > can use up to 8 characters. > > I hacked up a short program to test this: > > main() > { > test1234(); > test1235(); > } > > test1234() > { > printf ("\nWorking"); > } > > test1235() > { > printf ("\nAlso working"); > } > > > This generated: > Multiply defined: test5.o;_test123 > > So it would seem that function names can only be 7 characters in > length. I am not sure if limitations of early cc were documented > anywhere. When I backported unirubik to v5 it compiled the longer > functions without any problem. > > Did anyone document these sorts of limitations of early cc? Does > anyone remember when cc started to use function names longer than 7 > characters? > > Mark > _______________________________________________ > TUHS mailing list > TUHS at minnie.tuhs.org > https://minnie.tuhs.org/mailman/listinfo/tuhs