🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1155

Problem with cpp: off by one line (#include <file.h)

#1155
From: Bruce G. Barnett
Date: Thu, 08 Sep 1988 02:13
26 lines
1038 bytes
I noticed the following bug that is reproducible on SunOS 3.X, SunOS
4.0, and Ultrix 2.0.

Problem:
	cpp gets confused with missing ">" in include directive.
	The line numbers are off by one.

Repeat by:

	csh> cat -n bug.c
	cat -n bug.c
	     1	#include <stdio.h
	     2	main()
	     3	{
	     4		crud=12g0;
	     5	}
	csh> cc -c bug.c
	cc -c bug.c
	"bug.c", line 5: crud undefined
	"bug.c", line 5: syntax error

Note that cpp doesn't complain about the missing ">".
Also the line number is off by one.
-- 
	Bruce G. Barnett 	<barnett@ge-crd.ARPA> <barnett@steinmetz.UUCP>
				uunet!steinmetz!barnett
Technical Details
Message-ID: <5397@vdsvax.steinmetz.ge.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!steinmetz!vdsvax!barnett

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!steinmetz!vdsvax!barnett
From: barnett@vdsvax.steinmetz.ge.com (Bruce G. Barnett)
Newsgroups: comp.bugs.4bsd
Subject: Problem with cpp: off by one line (#include <file.h)
Keywords: cpp
Message-ID: <5397@vdsvax.steinmetz.ge.com>
Date: 8 Sep 88 02:13:35 GMT
Reply-To: barnett@steinmetz.ge.com (Bruce G. Barnett)
Organization: General Electric CRD, Schenectady, NY
Lines: 26