dhp@ihnp3.UUCP (Douglas H. Price) (08/14/84)
I've watched the assorted flaming about the supposed bug in the System V C compiler with some amusement. I suggest, however, that it more appropriately belongs in either net.lang.c or better yet net.flame, since this is a case of what you want it to do rather than what it currently does. It clearly states on page 179 of K & R (reference section 2.2) that in the K & R definition of C that no more than the first eight characters are significant, with the possibility that various local assemblers and loaders might put additional restrictions on externals. In fact, it explicitly states that only seven chars are significant on a PDP-11, the parent compiler to the VAX. So, what you are really arguing about is not a bug in the compiler, but rather an arbitrary limitation of the assembler and loader on the machine. As a note to you who are implementing what you intend to be fully portable code; you have even tighter restrictions. The only way you can have moderate assurance that the program will link on non-UNIX systems is if you limit your externals to six characters, upper case only. It looks ugly, but it works. It just so happens that longer externs will be supported in System V.2 so this whole argument will soon be moot anyway. -- Douglas H. Price Analysts International Corp. @ AT&T Bell Laboratories ..!ihnp4!ihnp3!dhp
gwyn@BRL-VLD.ARPA (08/14/84)
From: Doug Gwyn (VLD/VMB) <gwyn@BRL-VLD.ARPA> For totally mysterious reasons, many UNIX sites will not be running UNIX System V Release 2 any time soon, and not everyone using C has a UNIX system anyhow. Therefore the issue of restricted-length C symbols remains relevant for a while, until there is an official C standard requiring otherwise and until a "reasonable" amount of time for compiler vendors to comply has elapsed. Note also that the PDP-11 version of UNIX System V Release 2 does NOT support flexnames.
chris@umcp-cs.UUCP (08/21/84)
Not having a Sys V Rel 1 compiler handy to test this, I will only say that the compiler is doing weird things if it does complain about #1 or doesn't complain about #2. #1: foo () { int a2345678; int a2345679; a2345678 = 1; a2345679 = 0; } #2: int a2345678; int a2345679; foo () { a2345678 = 1; a2345679 = 0; } (I prefer FLEXNAMES myself!) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland