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/92326] [10 Regression] wrong bound in zero-length array diagnostics Date: Thu, 16 Apr 2020 07:43:33 +0000 [thread overview] Message-ID: <bug-92326-4-tmWnuj7Ilr@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-92326-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92326 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marxin at gcc dot gnu.org Resolution|FIXED |--- Status|RESOLVED |REOPENED --- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> --- The qemu test-case is still reported as warning. Reduced test-case: $ cat qemu.i struct A a; int c, d; struct A { int scalar; int flexible[]; }; void g() { a.flexible[c] = d; } $ gcc -O2 -c qemu.i -Werror=array-bounds qemu.i: In function ‘g’: qemu.i:11:13: error: array subscript <unknown> is outside array bounds of ‘int[]’ [-Werror=array-bounds] 11 | a.flexible[c] = d; | ~~~~~~~~~~^~~ qemu.i:7:7: note: while referencing ‘flexible’ 7 | int flexible[]; | ^~~~~~~~ qemu.i:1:10: note: defined here ‘a’ 1 | struct A a; | ^ cc1: some warnings being treated as errors
next prev parent reply other threads:[~2020-04-16 7:43 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-92326-4@http.gcc.gnu.org/bugzilla/> 2020-04-13 18:39 ` msebor at gcc dot gnu.org 2020-04-13 21:32 ` cvs-commit at gcc dot gnu.org 2020-04-13 21:33 ` msebor at gcc dot gnu.org 2020-04-16 7:43 ` marxin at gcc dot gnu.org [this message] 2020-04-16 23:50 ` msebor at gcc dot gnu.org 2020-04-17 7:35 ` marxin at gcc dot gnu.org 2020-04-17 15:02 ` msebor 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-92326-4-tmWnuj7Ilr@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).