https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84051

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|9.0                         |11.0
         Resolution|---                         |FIXED

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 11 issues the following warning for the test case in comment #0:

$ gcc -O2 -S -Wall pr84851.c
pr84851.c: In function ‘f’:
pr84851.c:5:14: warning: array subscript 7 is above array bounds of ‘A4’ {aka
‘int[4]’} [-Warray-bounds]
    5 |   return (*p)[7];
      |          ~~~~^~~
pr84851.c:3:12: note: while referencing ‘p’
    3 | int f (A4 *p)
      |        ~~~~^

Reply via email to