From mboxrd@z Thu Jan 1 00:00:00 1970 From: lm@mcvoy.com (Larry McVoy) Date: Thu, 16 Oct 2014 19:52:42 -0700 Subject: [TUHS] early cc variable and function names In-Reply-To: <20141017024049.GI17227@mercury.ccil.org> References: <20141017022913.7A77818C092@mercury.lcs.mit.edu> <20141017024049.GI17227@mercury.ccil.org> Message-ID: <20141017025242.GH6963@mcvoy.com> On Thu, Oct 16, 2014 at 10:40:49PM -0400, John Cowan wrote: > Noel Chiappa scripsit: > > > 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. > > The _ was only for externals, including all procedure names. It prevented > collisions with names introduced into the assembly-language source or > in libc. This is perhaps a side note but I believe all structure fields shared a namespace. So stat.size and whatever.size were not allowed, they collided. So we got sb.st_size which I personally love and wish it were still like that. xyz.size abc.size foobar.size What are the types of those structures? abc.st_size Huh, abc is a struct stat. I get that it was a bug and needed to be fixed but I wish that everyone still pretended that it was one namespace, makes code so much easier to read. -- --- Larry McVoy lm at mcvoy.com http://www.mcvoy.com/lm