how widespread is this cpp bug?

Kok Chen kchen at Apple.COM
Thu Dec 1 09:00:43 AEST 1988


In article <49179 at pyramid.pyramid.com> markhall at pyramid.UUCP (Mark Hall) writes:
>The following code compiles and runs on pyramid, att-3b2, and sun3:
>
>	#include <stdio.h>
>	main() 
>	{
>		prin/* comment in the middle */tf ( "Hello World.\n" );
>	}
> ...
>
>Does your cpp have this `feature'?  Anyone know the history?  I
>suspect that AT&T and SUN know about this, but have chosen not to fix it.
>Anyone know why?
>

Boy, have I seen this "feature" abused! (Greenhills 68k accepts it, the 
last I looked.)  The worst abuse was of the form:

#define	FOO( x,y )    foo/**/x( y )

main()
{
    FOO( bar, 1 ) ;
    FOO( baz, 2 ) ;
}

foobar( z )
{
}

foobaz( z )
{
}

Readability?  Half of the folks who encountered that segment of code
asked what it did.  When they found out, they questioned the sanity of
the author.


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



More information about the Comp.lang.c mailing list