Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!weitek!pyramid!markhall
From: markhall@pyramid.pyramid.com (Mark Hall)
Newsgroups: comp.lang.c
Subject: how widespread is this cpp bug?
Summary: ``whitespace separates tokens''
Keywords: cpp whitespace bug
Message-ID: <49179@pyramid.pyramid.com>
Date: 30 Nov 88 18:23:49 GMT
Reply-To: markhall@pyramid.UUCP (Mark Hall)
Organization: Pyramid Technology Corp., Mountain View, CA
Lines: 37

The following code compiles and runs on pyramid, att-3b2, and sun3:

	#include 
	main() 
	{
		prin/* comment in the middle */tf ( "Hello World.\n" );
	}

But, according to K&R pg. 179:

	``... comments [...] as described below
	are ignored except as they serve to separate tokens.''

So the above program is actually in error, as `prin' and `tf' should
be two separate tokens.  I was going to fix our cpp until I realized 
how pervasive the bug is.   Looking into the June draft of the standard
I see that they have addressed this problem explicitly, and mention that
all comments are to be replaced with a single space.  I hear that
this `feature' is used for gluing togehter tokens, as in:

#define VERSION 2
main() {
	proc/**/VERSION( a,b,c );
}

which, given the buggy cpp, will produce:

main() {
	proc2( a,b,c );
}

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?

-Mark Hall (smart mailer): markhall@pyramid.pyramid.com
	   (uucp paths): {ames|decwrl|sun|seismo}!pyramid!markhall