This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cs] _cpp_clean_lines patch
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Per Bothner <per at bothner dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Aug 2003 06:28:48 +0100
- Subject: Re: [cs] _cpp_clean_lines patch
- References: <3F454677.9060908@bothner.com>
Per Bothner wrote:-
> I checked the attached patch into the compile-server branch.
> My hope is with this patch the line-number info is correct,
> making debugging (and error messages) much easier to deal with!
Well, it won't be the same as the first pass through, as you
no longer have the line notes. Therefore with your patch
on the 2nd pass through, everything will appear to be on
one physical line that used to be spread across many.
The correct fix is to save the line notes with the buffer,
and to re-use them.
> There is still the problem that if a fragment (or file) is
> re-parsed, we don't get the line notes and associated error
> messages. Neil, I'm afraid I don't quite see the purpose of
> the line notes. Why don't we do the the error-checking in
> _cpp_process_line_notes while we're in _cpp_clean_lines? Is
> it a performance issue?
It's not context-sensitive for a start, so we'd get warnings
about trigraphs in comments, for example.
Also, it means that CPP warnings would appear out-of-order
w.r.t. compiler warnings, which is a QOI issue.
There are probably other reasons, but I've not attempted
to remember for more than the last 20s 8-)
Neil.