Problem with cpp: off by one line (#include <file.h)
Bruce G. Barnett
barnett at vdsvax.steinmetz.ge.com
Thu Sep 8 12:13:35 AEST 1988
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 at ge-crd.ARPA> <barnett at steinmetz.UUCP>
uunet!steinmetz!barnett
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list