public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/104030] [12 Regression] -Wbidi-chars should not warn about UCNs Date: Mon, 24 Jan 2022 22:49:28 +0000 [thread overview] Message-ID: <bug-104030-4-65nabt2s8h@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104030-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104030 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:ae36f839632ddb67a53c26e9c7e73b0f56c4c11b commit r12-6850-gae36f839632ddb67a53c26e9c7e73b0f56c4c11b Author: Marek Polacek <polacek@redhat.com> Date: Wed Jan 19 19:05:22 2022 -0500 preprocessor: -Wbidi-chars and UCNs [PR104030] Stephan Bergmann reported that our -Wbidi-chars breaks the build of LibreOffice because we warn about UCNs even when their usage is correct: LibreOffice constructs strings piecewise, as in: aText = u"\u202D" + aText; and warning about that is overzealous. Since no editor (AFAIK) interprets UCNs to show them as Unicode characters, there's less risk in misinterpreting them, and so perhaps we shouldn't warn about them by default. However, identifiers containing UCNs or programs generating other programs could still cause confusion, so I'm keeping the UCN checking. To turn it on, you just need to use -Wbidi-chars=unpaired,ucn or -Wbidi-chars=any,ucn. The implementation is done by using the new EnumSet feature. PR preprocessor/104030 gcc/c-family/ChangeLog: * c.opt (Wbidi-chars): Mark as EnumSet. Also accept =ucn. gcc/ChangeLog: * doc/invoke.texi: Update documentation for -Wbidi-chars. libcpp/ChangeLog: * include/cpplib.h (enum cpp_bidirectional_level): Add bidirectional_ucn. Set values explicitly. * internal.h (cpp_reader): Adjust warn_bidi_p. * lex.cc (maybe_warn_bidi_on_close): Don't warn about UCNs unless UCN checking is on. (maybe_warn_bidi_on_char): Likewise. gcc/testsuite/ChangeLog: * c-c++-common/Wbidi-chars-10.c: Turn on UCN checking. * c-c++-common/Wbidi-chars-11.c: Likewise. * c-c++-common/Wbidi-chars-14.c: Likewise. * c-c++-common/Wbidi-chars-16.c: Likewise. * c-c++-common/Wbidi-chars-17.c: Likewise. * c-c++-common/Wbidi-chars-4.c: Likewise. * c-c++-common/Wbidi-chars-5.c: Likewise. * c-c++-common/Wbidi-chars-6.c: Likewise. * c-c++-common/Wbidi-chars-7.c: Likewise. * c-c++-common/Wbidi-chars-8.c: Likewise. * c-c++-common/Wbidi-chars-9.c: Likewise. * c-c++-common/Wbidi-chars-ranges.c: Likewise. * c-c++-common/Wbidi-chars-18.c: New test. * c-c++-common/Wbidi-chars-19.c: New test. * c-c++-common/Wbidi-chars-20.c: New test. * c-c++-common/Wbidi-chars-21.c: New test. * c-c++-common/Wbidi-chars-22.c: New test. * c-c++-common/Wbidi-chars-23.c: New test.
next prev parent reply other threads:[~2022-01-24 22:49 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-14 14:51 [Bug preprocessor/104030] New: " sbergman at redhat dot com 2022-01-14 14:55 ` [Bug preprocessor/104030] [12 Regression] " mpolacek at gcc dot gnu.org 2022-01-14 14:59 ` jakub at gcc dot gnu.org 2022-01-14 15:00 ` jakub at gcc dot gnu.org 2022-01-14 15:05 ` mpolacek at gcc dot gnu.org 2022-01-14 15:07 ` mpolacek at gcc dot gnu.org 2022-01-14 15:30 ` jakub at gcc dot gnu.org 2022-01-14 15:41 ` sbergman at redhat dot com 2022-01-18 13:52 ` rguenth at gcc dot gnu.org 2022-01-24 22:49 ` cvs-commit at gcc dot gnu.org [this message] 2022-01-24 22:50 ` mpolacek at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-104030-4-65nabt2s8h@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).