public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "david.post at ohyonghao dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/101628] New: Preprocessor errors on extended characters in #if 0 code block Date: Mon, 26 Jul 2021 17:19:35 +0000 [thread overview] Message-ID: <bug-101628-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101628 Bug ID: 101628 Summary: Preprocessor errors on extended characters in #if 0 code block Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: david.post at ohyonghao dot com Target Milestone: --- In a #if 0 code block, the presence of characters outside the extended character set being used as an identifier still gets passed to the C++ compiler and errors out with the message: error: extended character ∂ is not valid in an identifier Sample code: int main(int argc, char **argv){ #if 0 Q_∂(false) #endif return 0; } The code within the #if 0 block should never be compiled which is the behavior of other compilers such as clang++ which gleefully ignores bad code within #if 0 block. To clarify, with clang++ the code errors without the #if 0 block, which is expected behavior, and compiles with the #if 0 block around the bad code. g++ errors in both cases.
next reply other threads:[~2021-07-26 17:19 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-26 17:19 david.post at ohyonghao dot com [this message] 2021-07-26 18:43 ` [Bug preprocessor/101628] " pinskia at gcc dot gnu.org 2021-07-27 11:04 ` rguenth at gcc dot gnu.org 2021-07-27 16:58 ` david.post at ohyonghao dot com 2021-07-27 17:23 ` schwab@linux-m68k.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-101628-4@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).