[PATCH] Multibyte awareness for diagnostics (PR 49973)
David Malcolm
dmalcolm@redhat.com
Mon Dec 9 20:12:00 GMT 2019
On Fri, 2019-12-06 at 15:31 -0500, Lewis Hyatt wrote:
> On Fri, Dec 06, 2019 at 10:54:30AM -0500, David Malcolm wrote:
[...]
> > The patch is OK for trunk with the nits above fixed. Do you have
> > commit access? (I've got my own patch [1] that touches diagnostic-
> > show-locus.c which I'll need to refresh once yours goes in); need
> > to
> > remember to include those data files when committing.
> >
> > Thanks very much for fixing this, and sorry again for the delay in
> > reviewing it.
>
> That's wonderful, thanks very much. Happy to contribute something. I
> do not
> have commit access so if you could please apply it, that would be
> great.
Thanks; I've committed it on your behalf to trunk as r279137 (including
the data files).
FWIW I made a few minor fixes:
* I added a ChangeLog entry for contrib/unicode/unicode-license.txt,
and added the PR reference to the gcc/testsuite/ChangeLog.
* I also moved the top-level ChangeLog to contrib/ChangeLog, updating
the paths.
* I updated the instructions to reflect the path of the generated file:
-3. Run ./gen_wcwidth.py X.Y > ../../libcpp/generated_wcwidth.h
+3. Run ./gen_wcwidth.py X.Y > ../../libcpp/generated_cpp_wcwidth.h
(I tested regenerating the file and got the same result as you, on
supplying "12.1.0")
and did another bootstrap®ression test (on x86_64-pc-linux-gnu) for
good measure.
> Might I also trouble you to please have a look at this one:
> https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00766.html ?
Looking now.
> It is very much shorter than this one and fixes just a couple
> glitches in
> pretty-print.c -- UTF-8 gets mangled when printed via %q, and line-
> wrapping
> shouldn't wrap in the middle of a UTF-8 sequence. That's the only
> other
> issue I am aware of as far as diagnostics with multibyte characters
> go.
If you feel like tackling a related issue, maybe have a look at how we
print tab characters in diagnostic_show_locus; we should probably
resolve them into spaces (respecting -ftab-stop [1]), since when we
print them as tabs after a left-margin for line-numbers the
"tabification" is mangled. I don't know if there's a bug for this in
bugzilla, but it seems tightly related to this column-handling work.
> Thanks again!
Thanks for all your work putting the patch together.
Dave
[1] see also c-indentation.c; gah
More information about the Gcc-patches
mailing list