[TUHS] early cc variable and function names

Noel Chiappa jnc at mercury.lcs.mit.edu
Fri Oct 17 12:29:13 AEST 2014


    > From: Mark Longridge <cubexyz at gmail.com>

    > It seems like early cc could only use variable and function names up to
    > 8 characters.
    > This limitation occurs in v5, v6 and v7.
    > ...    
    > 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.

The a.out symbol tables use 8-character fields to hold symbol names. However,
C automagically and unavoidably prepends an _ to all externals (I forget
about automatics, registers, etc - too tired to check right now), making the
limit for C names 7 characters.

    > I am not sure if limitations of early cc were documented anywhere.

I remember reading the above.

Other limits... well, you need to remember that C was still changing in that
period, so limits were a moving target.

    > When I backported unirubik to v5 it compiled the longer functions
    > without any problem.

ISTR that C truncated external names longer than 7 characters. Probably the
ones in that program were all unique within 7, so you won.

    > Did anyone document these sorts of limitations of early cc?

I seem to recall at least one document from that period (I think pertaining
to the so-called 'Typesetter C') about 'changes to C'.

Also, I have started a note with a list of 'issues with C when you're
backporting V7 and later code to V6', I'll see if I can dig them out tomorrow.

	Noel



More information about the TUHS mailing list