public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/63357] Warn for P && P and P || P (same expression used multiple times in a condition) Date: Fri, 24 Feb 2023 08:56:07 +0000 [thread overview] Message-ID: <bug-63357-4-nYCoXqVx6K@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-63357-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63357 David Binderman <dcb314 at hotmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcb314 at hotmail dot com --- Comment #8 from David Binderman <dcb314 at hotmail dot com> --- This could probably be extended to other operators. Static analyser cppcheck can be made to say things like: linux-6.2/drivers/spi/spi-sn-f-ospi.c:614:31: style: Same expression 'SPI_TX_OCTAL' found multiple times in chain of '|' operators. [duplicateExpression] Source code is ctlr->mode_bits = SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL | SPI_RX_QUAD | SPI_TX_OCTAL | SPI_MODE_0 | SPI_MODE_1 | SPI_LSB_FIRST; If |, then probably also &.
next prev parent reply other threads:[~2023-02-24 8:56 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-09-24 10:26 [Bug c/63357] New: Warn for P && P and P || P mpolacek at gcc dot gnu.org 2014-12-10 8:56 ` [Bug c/63357] " mpolacek at gcc dot gnu.org 2014-12-10 9:22 ` [Bug c/63357] Warn for P && P and P || P (same expression used multiple times in a condition) burnus at gcc dot gnu.org 2015-04-21 6:04 ` mpolacek at gcc dot gnu.org 2015-04-22 10:01 ` mpolacek at gcc dot gnu.org 2015-04-24 12:11 ` mpolacek at gcc dot gnu.org 2015-04-24 12:12 ` mpolacek at gcc dot gnu.org 2023-02-24 8:56 ` dcb314 at hotmail dot com [this message] 2023-02-24 10:49 ` manu at gcc dot gnu.org 2023-02-24 14:23 ` 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-63357-4-nYCoXqVx6K@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).