Article View: comp.bugs.4bsd
Article #1155Problem with cpp: off by one line (#include <file.h)
From: Bruce G. Barnett
Date: Thu, 08 Sep 1988 02:13
Date: Thu, 08 Sep 1988 02:13
26 lines
1038 bytes
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!barnettShow 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