public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105164] new warning in clang, missing in gcc: -Wbitwise-instead-of-logical Date: Wed, 06 Apr 2022 12:12:12 +0000 [thread overview] Message-ID: <bug-105164-4-bsh080IyWm@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105164-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105164 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org Status|ASSIGNED |NEW --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Well, I doubt the warning is much useful. There are situations where we can't use short-circuit evaluation: gcc/c-family/c-attribs.cc:2384: else if (TREE_CODE (decl) == FUNCTION_DECL && (((curalign = DECL_ALIGN (decl)) > bitalign) | ((lastalign = DECL_ALIGN (last_decl)) > bitalign))) or we want to quickly and flags of a struct: gcc_checking_assert (!IDENTIFIER_KIND_BIT_2 (id) & !IDENTIFIER_KIND_BIT_1 (id) & !IDENTIFIER_KIND_BIT_0 (id)); Note a different code is generated for situations like: return foo() && bar() && baz (); and return foo() & bar() & baz (); So I don't think we should change the code based on the warnings.
next prev parent reply other threads:[~2022-04-06 12:12 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-05 16:16 [Bug c++/105164] New: " dcb314 at hotmail dot com 2022-04-05 21:24 ` [Bug c++/105164] " dcb314 at hotmail dot com 2022-04-06 7:51 ` rguenth at gcc dot gnu.org 2022-04-06 9:08 ` marxin at gcc dot gnu.org 2022-04-06 12:12 ` marxin at gcc dot gnu.org [this message] 2022-04-06 16:30 ` dcb314 at hotmail dot com 2022-04-06 16:32 ` dcb314 at hotmail dot com
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-105164-4-bsh080IyWm@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).