obtrusive line number in cpp

Col. G. L. Sicherman gls at cbnewsh.ATT.COM
Sat Sep 16 03:28:12 AEST 1989


Here's an annoying cpp bug that seems to have been around for
a while.  I'm on a 3B2 running Vr3:

	$ what /lib/cpp
	/lib/cpp:
		/lib/cpp.sl 1.13 4.2 05/14/87 11610 AT&T-SF
	$ cat tst.c
	#define SQUARE(x) ((x) * (x))
	#define CUBE(x) ((x) * (x) * (x))

	void exit();

	main()
	{
		int a, b;

		a = 3;
		b = SQUARE(
			a) + CUBE(
			a);
		printf("%d\n", b);
		exit(0);
	}
	$ /lib/cpp tst.c
	# 1 "tst.c"



	void exit();

	main()
	{
		int a, b;

		a = 3;
		b = (( 		a) * ( 		a)) + # 13 "tst.c"
	(( 		a) * ( 		a) * ( 		a));
	# 14 "tst.c"
		printf("%d\n", b);
		exit(0);
	}
	$

Naturally the output won't compile with "# 13" in the middle of
a line.  Does anybody have a fix for this?
-- 
G. L. Sicherman
gls at odyssey.att.COM



More information about the Comp.bugs.sys5 mailing list