CPP outputs wrong number of newlines sometimes

Neil Booth NeilB@earthling.net
Mon Sep 25 14:29:00 GMT 2000


Hi Jamie,

Could you send the bugs to gcc-bugs?

Jamie Lokier wrote:-

> > The line number is not properly maintained when the multi-line string is
> > printed.  Something similar happens with multi-line comments when -C is
> > used.

Thanks for spotting that.

> Patch attached.  Let me know if it's useful (I haven't yet signed papers).

Probably.  I'd rather not scan the string / comment again,
particularly if we're moving towards multibyte char support.  It might
be better to somehow record the number of lines involved when lexing
these tokens.  That would be easy (just the difference between
buffer->lineno before and after the relevant function call); finding
the place to store that info would be harder.  Don't you just love GNU
extensions? <g>

Maybe you could get the paperwork done anyway.  I'm sure it'd be
useful for the future.

Thanks,

Neil.


More information about the Gcc mailing list