[Bug c++/104906] New: UTF-8 bytes output in diagnostic regardless of locale

roland.illig at gmx dot de gcc-bugzilla@gcc.gnu.org
Sun Mar 13 18:16:50 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104906

            Bug ID: 104906
           Summary: UTF-8 bytes output in diagnostic regardless of locale
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland.illig at gmx dot de
                CC: egallager at gcc dot gnu.org
  Target Milestone: ---

>From cp/module.cc:
          inform (loc, "compiler is %sversion %s%s%s",
                  IS_EXPERIMENTAL (my_ver) ? "experimental " : "",
                  my_string,
                  reject_p ? "" : flag_module_version_ignore
                  ? ", be it on your own head!" : ", close enough?",
                  reject_p ? "" : " \xc2\xaf\\_(\xe3\x83\x84)_/\xc2\xaf");

Are you sure that you want to output this UTF-8 sequence in locale "C"? 
Furthermore, the conditional strings must be translatable.  See the GCC
diagnostics guidelines for more information.

What would happen if this diagnostic were printed in an EBCDIC environment? 
Might the UTF-8 sequence "\xe3\x83\x84" show up as "Tcd" there?


More information about the Gcc-bugs mailing list