This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/49973] Column numbers count special characters as multiple columns
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Jan 2018 19:47:34 +0000
- Subject: [Bug preprocessor/49973] Column numbers count special characters as multiple columns
- Auto-submitted: auto-generated
- References: <bug-49973-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49973
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=69664
--- Comment #12 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #11)
> This should be fixed in libcpp, probably in lex.c, but maybe other places
> also. A good testcase to start with would be:
>
> /* ñ /* */
> /* a /* */
>
> cc1 -Wcomment
>
> prog.cc:1:7: warning: "/*" within comment [-Wcomment]
> /* ñ /* */
> ^
> prog.cc:2:6: warning: "/*" within comment [-Wcomment]
> /* a /* */
> ^
>
> Both locations should point to column 6. Look for places where column info
> is converted to source_location (linemap_position_for_column or
> linemap_position_for_line_and_colum). Figure out where the column info got
> the wrong value. Use something like wcwidth() to measure the width of
> non-ASCII characters and get the right width of 'ñ'.
>
> Unfortunately, GCC 6 seems to be broken for the above testcase
> (https://gcc.gnu.org/PR69664). Revision 229665 seems fine.
Bug 69664 is fixed now.