public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "colomar.6.4.3 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/94754] -fanalyzer false positive due to it ignoring previous if Date: Sat, 25 Apr 2020 00:35:11 +0000 [thread overview] Message-ID: <bug-94754-4-2MOfZXClAL@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94754-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94754 --- Comment #1 from Alejandro Colomar <colomar.6.4.3 at gmail dot com> --- __builin_unreachable() helped silencing that specific bug, as a temporary workaround: [[gnu::nonnull]] static int init_x(int cond, int **x, int *y) { if (!cond) return -1; *x = y; return 0; } int foo(int cond) { int *x; int y = 7; if (cond < 2) return -1; /* cond >= 2 != 0, so it will initialize x and return 0 */ if (init_x(cond, &x, &y)) __builtin_unreachable(); return *x; }
next prev parent reply other threads:[~2020-04-25 0:35 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-25 0:20 [Bug analyzer/94754] New: " colomar.6.4.3 at gmail dot com 2020-04-25 0:35 ` colomar.6.4.3 at gmail dot com [this message] 2020-04-28 13:26 ` [Bug analyzer/94754] " cvs-commit at gcc dot gnu.org 2020-04-28 13:33 ` dmalcolm 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-94754-4-2MOfZXClAL@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).