This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [cs] _cpp_clean_lines patch


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.


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