Bug in Unix System V C compiler

ron at BRL-TGR.ARPA ron at BRL-TGR.ARPA
Tue Aug 7 01:06:34 AEST 1984


From:      Ron Natalie <ron at BRL-TGR.ARPA>

The truth of the matter that with the system V compiler only 7
characters are significant.  If you had done the test that the
person reporting the bug had asked to, you would have seen the
problem.  The test had eight character identifiers, not nine as
you used in your example.  When you use two identifiers that
differ only in the eighth character it generates a message
saying the identifiers conflict.  This is only slightly better
than the earlier versions of the compiler that actually used
the same symbol for both and caused the assembler's heart to
break, issuing the message 'm 0012'.  Not entirely obvious.

This is all becuase the C compiler prepends it's variable names
with _ making the eight character names nine characters and the
assmebler only has eight characters of significance as well.
One solution would be not to prefix the symbol with the underscore.
This leads to other problems.  The RSI compiler for the 370 did this.
When you declare C variables to be things like R0 all hell breaks
loose.

-Ron



More information about the Comp.unix.wizards mailing list