public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/47444] False warning: array subscript is above array bounds Date: Tue, 25 Jan 2011 13:17:00 -0000 [thread overview] Message-ID: <bug-47444-4-PMRgcnJFmG@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-47444-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47444 --- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-01-25 12:58:12 UTC --- (In reply to comment #4) > Well. You might argue that the wording should be 'may be' in all cases > where the offending statement might not be executed (which is certainly > undecidable as you can't know whether the function is executed at all). > But it also isn't the way we handle other warnings (in particular the > uninitialized variable uses). This is strange. We *precisely* says "is uninitialized" when it can be proved that it happens and "may be uninitialized" when it is just some code-paths or we cannot prove that it doesn't happen. And we certainly (or used to, I haven't been following these bugs lately) classify as bugs when the wrong message is printed. > Thus I think we should not fix this bug (and it is a non-bug, as certainly > the code in question isn't obviously dead). > > Interprocedual analysis could see that we call the function with a boolean > value (thus, either 0 or 1). > > That said - we can't suit everyone with this kind of warnings. Then I guess we should just point out people to static analysis tools, like http://clang-analyzer.llvm.org/, which are more suited for this task than GCC.
next prev parent reply other threads:[~2011-01-25 12:58 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-01-24 19:20 [Bug c++/47444] New: " eidletni at mail dot ru 2011-01-24 21:32 ` [Bug c++/47444] " pinskia at gcc dot gnu.org 2011-01-24 22:48 ` paolo.carlini at oracle dot com 2011-01-24 23:01 ` manu at gcc dot gnu.org 2011-01-25 11:09 ` rguenth at gcc dot gnu.org 2011-01-25 13:17 ` manu at gcc dot gnu.org [this message] 2011-01-25 13:20 ` redi at gcc dot gnu.org 2011-01-25 13:25 ` manu at gcc dot gnu.org 2011-01-25 19:10 ` eidletni at mail dot ru 2011-01-25 19:46 ` redi at gcc dot gnu.org 2011-01-25 19:53 ` eidletni at mail dot ru 2011-03-26 16:06 ` aj664 at hotmail dot com 2011-03-26 17:49 ` aj664 at hotmail dot com 2011-03-26 18:41 ` manu at gcc dot gnu.org 2012-10-31 19:25 ` eidletni at mail dot ru
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-47444-4-PMRgcnJFmG@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).