This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cpp generates wrong #line directives


Hi,

When there are #line directives in a source C files, the #line
directives emitted by "gcc -E" from this source file can be very
different from the given ones. As a consequence, functions below that
point get very wrong debugging information, and gdb displays totally
useless line numbers.

The data for this testcase is in
http://clisp.cons.org/~haible/bug-cpp-20000901.tar.gz
or
ftp://clisp.cons.org/pub/lisp/clisp/snapshots/bug-cpp-20000901.tar.gz

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
$ gcc -E stream.c > stream.i 

First look at stream.c line 10136. It contains a "#line 9811" statement,
such that the following "goto read_next_char;" should be remembered as
line 9818.

Now look at stream.i line 43508. It contains a "# 9851" statement,
thus pretending that the following "goto read_next_char;" were in line
9852. This is off by 33 lines.

Bruno

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]