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

Reply via email to