This one bit me today

Conor P. Cahill cpcahil at virtech.uucp
Fri Nov 10 00:37:04 AEST 1989


In article <136 at csnz.co.nz>, paul at csnz.co.nz (Paul Gillingwater) writes:
> In article <11463 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
> >The most reasonable one was to add //-comment-to-end-of-line style
> >comments.  ...  However, it was quite a bother
> >when our //-ed code had to be compiled by a compiler that hadn't
> >received this hack!
> 
> sed -d ?^//? < foo.c > tmp.c ; cc tmp.c -o foo

Just a few problems with this solution:

	1. It's a pain in the *ss to change all the makefiles

	2. Error messages from the cc tmp.c will point to the wrong line numbers
	
	3. A source level debugger would require the tmp.c file to stay around
	   which would require you the use a different name for each file.  If
	   you chose to add a letter to the begining (like Tfoo.c), you run the
	   risk of making a file name that is too long for the system.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.lang.c mailing list