Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Karl Berry
Wed, 11 Nov 1992 05:58
gcc 2.3.1 -- filename in errors wrong?
Author: Karl Berry
Date: Wed, 11 Nov 1992 05:58
Date: Wed, 11 Nov 1992 05:58
35 lines
1791 bytes
1791 bytes
It seems the preprocessor in GCC 2.3.1 sometimes gets confused as to what file to report errors in. Consider the following five-line file foo.c: extern int a; extern int b; #line 1 "./foo.y" foo #include "foo.h" And the one-line file foo.h: extern int x; Running `gcc foo.c' reports the error at the erroneous `foo' as follows: In file included from foo.c:2: ./foo.h:1: syntax error before `extern' That should be `In file included from foo.y:2:'. Line two of foo.c is not in error. This was on a 486 running Interactive Unix 2.2.1 (configured as --with-gnu-as i386-isc), and also on an IBM RT running AOS/4.3BSD (configured as romp-aos), but I doubt the bug is system-dependent. On the 486, the complete -v output is the following: Reading specs from /usr/local/gnu/lib/gcc-lib/i386-isc/2.3.1/specs gcc version 2.3.1 /usr/local/gnu/lib/gcc-lib/i386-isc/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dunix -Di386 -D__unix__ -D__i386__ -D__unix -D__i386 foo.c /tmp/cca21680.i GNU CPP version 2.3.1 (80386, BSD syntax) /usr/local/gnu/lib/gcc-lib/i386-isc/2.3.1/cc1 /tmp/cca21680.i -quiet -dumpbase foo.c -version -o /tmp/cca21680.s GNU C version 2.3.1 (80386, BSD syntax) compiled by GNU C version 2.3.1. In file included from foo.c:2: ./foo.h:1: syntax error before `extern'
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads