3.0 bogus file information in debugging output

Zack Weinberg zack@codesourcery.com
Mon Feb 4 02:35:00 GMT 2002


On Fri, Feb 01, 2002 at 04:53:04AM +0100, Carlo Wood wrote:
> NOTICE  : lines.cc:16
> NOTICE  : foo.c:17
> NOTICE  : bar.c:18
> (and the same result for stabs)
> 
> I suppose that is right?
> I didn't know that the '#line' line didn't increment __LINE__.
> Otherwise I'd have expected:
> NOTICE  : lines.cc:16
> NOTICE  : foo.c:17
> NOTICE  : bar.c:19

Yeah, that's right.  #line sets the line number of the _next_ line.  I
had forgotten this when I wrote the original -- the idea was to change
just the file name.  I guess you can't do that.  (The semantics here
make it easier to use #line for its normal purpose, i.e. what yacc
does with it.)

zw



More information about the Gcc-bugs mailing list