how widespread is this cpp bug?

Kok Chen kchen at Apple.COM
Fri Dec 2 03:44:57 AEST 1988


In <6625 at csli.STANFORD.EDU> wagner at arisia.xerox.com (Juergen Wagner) writes:
>Sun4 (SunOS 4.0):		bug!
>HP 9000/320 (HP-UX 6.0):	bug!
>VAX 8700 (Ultrix):		bug!
>
>So I tried one of our old TOPS-20 machines, which happily reported
>    Error at main+4, line 6 of x.c:
>      prin/*comment*/tf(
>    Undefined symbol: "prin"
>...

It should be pointed out that there are at least two C compilers in common
use on TOPS-20.  One is the Utah port of pcc that probably propagated this
"bug."  The other one started out as a "home grown" at Stanford (nowadays
called "kcc") and was not based on pcc but simply on what was gleamed 
off of K&R 1st Ed.  This latter was probably the one reported above (the 
format of the error messages looked familiar...).

The Stanford one did not even have a separate preprocessor (cpp) phase.  A 
single symbol table manager handled everything - macros, reserved words, 
identifiers, types, etc.  That is probably what caused it to reject the 
"prin/**/tf" construct (i.e., the lexical analyser stopped scanning 
"prin/**/tf" when it saw the first slash, returning the lexeme "prin").
I know for a fact :-) that nothing special was done to purposely reject the
"prin/**/tf" hack.

(The original version did, however, *purposely disallowed* goto's! :-) :-)


Kok Chen				{decwrl,sun}!apple!kchen
Apple Computer, Inc.



More information about the Comp.lang.c mailing list