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++/64524] New: gcc can't detect same expression in both parts of ternary operator Date: Wed, 07 Jan 2015 16:54:00 -0000 [thread overview] Message-ID: <bug-64524-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64524 Bug ID: 64524 Summary: gcc can't detect same expression in both parts of ternary operator Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Given this source code extern void g(int); void f( int n) { int i = (n >= 10) ? 1 : 1; g( i - 1); } then trunk gcc says nothing: $ ~/gcc/results/bin/gcc -c -O2 -Wall -Wextra jan6c.cc $ Here is cppcheck detecting the problem: $ ~/cppcheck/trunk/cppcheck --enable=all jan6c.cc Checking jan6c.cc... [jan6c.cc:9]: (style) Same expression in both branches of ternary operator. $ Fixing this bug would find about a dozen bugs in Linux kernel and about 100 bugs in Fedora Linux.
next reply other threads:[~2015-01-07 16:54 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-01-07 16:54 dcb314 at hotmail dot com [this message] 2015-01-07 17:49 ` [Bug c++/64524] " jakub at gcc dot gnu.org 2015-01-07 18:00 ` dcb314 at hotmail dot com 2015-01-07 18:12 ` jakub at gcc dot gnu.org 2015-01-07 19:45 ` maltsevm at gmail dot com 2015-01-07 20:12 ` pinskia at gcc dot gnu.org 2015-01-07 20:38 ` dcb314 at hotmail dot com 2015-01-07 20:39 ` 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-64524-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).