The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] early cc variable and function names
@ 2014-10-18 10:32 Noel Chiappa
  2014-10-18 23:03 ` Ron Natalie
  0 siblings, 1 reply; 21+ messages in thread
From: Noel Chiappa @ 2014-10-18 10:32 UTC (permalink / raw)


    > From: Greg 'groggy' Lehey <grog at lemis.com>

    > This is really an identifier issues

Probably actually a function of the relocatable object format / linker on the
machines in question, which in most (all?) cases predated C itself.

    > it's documented in K&R 1st edition, page 179:

Oooh, good piece of detective work!

	Noel



^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] early cc variable and function names
@ 2014-10-17 16:11 Noel Chiappa
  0 siblings, 0 replies; 21+ messages in thread
From: Noel Chiappa @ 2014-10-17 16:11 UTC (permalink / raw)


    > From: jnc at mercury.lcs.mit.edu (Noel Chiappa)

    >> 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'.
    > ...
    > I'll see if I can dig them out tomorrow.

OK, there are three documents which sort of fall into this class. First,
there is something titled "New C Compiler Features", no date, available here:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=Interdata732/usr/doc/cdoc/newstuff.nr

no date, but it appears to describe an early version of the so-called
'Typesetter C', mentioned in other documents, so this would be circa 1976 or
so.


There is a second document, untitled, no date, which I have not been able to
locate online at all. I scanned my hard-copy, available here:

  http://ana-3.lcs.mit.edu/~jnc/history/unix/CImprovements1.jpg
  ..
  http://ana-3.lcs.mit.edu/~jnc/history/unix/CImprovements5.jpg

From the content, it seems to be from shortly after the previous one, so say,
circa 1977.

Sorry about the poor readability (it looked fine on the monitor of the
machine my scanner is attached to); fudging with contrast would probably make
it more readable. When I get the MIT V6 Unix tapes read (they have been sent
off to a specialist in reading old tapes, results soon, I hope) I might be
able to get more info (e.g. date/filename), and machine-readable source.


Finally, there is "Recent Changes to C", from November 15, 1978, available
here:

  http://cm.bell-labs.com/cm/cs/who/dmr/cchanges.pdf
  
which documents a few final bits.


There is of course also Dennis M. Ritchie, "The Development of the C
Language", available here:

  http://cm.bell-labs.com/who/dmr/chist.html

which is a good, interesting history of 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 found several documents which are bits and pieces of this.

  http://ana-3.lcs.mit.edu/~jnc/history/unix/C_Backport.txt
  http://ana-3.lcs.mit.edu/~jnc/history/unix/V6_C.txt

Too busy to really clean them up at the moment.

	Noel



^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] early cc variable and function names
@ 2014-10-17  2:29 Noel Chiappa
  2014-10-17  2:40 ` John Cowan
  0 siblings, 1 reply; 21+ messages in thread
From: Noel Chiappa @ 2014-10-17  2:29 UTC (permalink / raw)


    > 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



^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] early cc variable and function names
@ 2014-10-17  1:51 Mark Longridge
  2014-10-17  2:20 ` Milo Velimirovic
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Mark Longridge @ 2014-10-17  1:51 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-10-18 23:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-18 10:32 [TUHS] early cc variable and function names Noel Chiappa
2014-10-18 23:03 ` Ron Natalie
2014-10-18 23:11   ` Dave Horsfall
  -- strict thread matches above, loose matches on Subject: below --
2014-10-17 16:11 Noel Chiappa
2014-10-17  2:29 Noel Chiappa
2014-10-17  2:40 ` John Cowan
2014-10-17  2:52   ` Larry McVoy
2014-10-17  3:46     ` John Cowan
2014-10-17  3:54       ` Larry McVoy
2014-10-17 19:41       ` Clem Cole
2014-10-17 20:37     ` random832
2014-10-17 20:42       ` Larry McVoy
2014-10-17  1:51 Mark Longridge
2014-10-17  2:20 ` Milo Velimirovic
2014-10-17  2:21 ` Dave Horsfall
2014-10-17 13:35   ` random832
2014-10-17 13:44     ` Warner Losh
2014-10-17 14:07       ` arnold
2014-10-17 14:22         ` Milo Velimirović
2014-10-17 19:29         ` random832
2014-10-18  7:25 ` Greg 'groggy' Lehey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).