public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109233] New: warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’
@ 2023-03-21 13:58 ubizjak at gmail dot com
  2023-03-21 14:01 ` [Bug c/109233] " ubizjak at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: ubizjak at gmail dot com @ 2023-03-21 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109233
           Summary: warning: array subscript 5 is above array bounds of
                    ‘struct tg3_napi[5]’
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com
  Target Milestone: ---

There is another bogus array bounds warning when compiling linux in:

drivers/net/ethernet/broadcom/tg3.c: In function ‘tg3_init_one’:
drivers/net/ethernet/broadcom/tg3.c:17787:51: error: array subscript 5 is above
array bounds of ‘struct tg3_napi[5]’ [-Werror=array-bounds=]
17787 |                 struct tg3_napi *tnapi = &tp->napi[i];
      |                                           ~~~~~~~~^~~
In file included from drivers/net/ethernet/broadcom/tg3.c:72:
drivers/net/ethernet/broadcom/tg3.h:3203:41: note: while referencing ‘napi’
 3203 |         struct tg3_napi                 napi[TG3_IRQ_MAX_VECS];
      |                                         ^~~~
drivers/net/ethernet/broadcom/tg3.c:17787:51: error: array subscript 5 is above
array bounds of ‘struct tg3_napi[5]’ [-Werror=array-bounds=]
17787 |                 struct tg3_napi *tnapi = &tp->napi[i];
      |                                           ~~~~~~~~^~~
drivers/net/ethernet/broadcom/tg3.h:3203:41: note: while referencing ‘napi’
 3203 |         struct tg3_napi                 napi[TG3_IRQ_MAX_VECS];
      |                                         ^~~~
cc1: all warnings being treated as errors

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-05-08 12:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 13:58 [Bug c/109233] New: warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’ ubizjak at gmail dot com
2023-03-21 14:01 ` [Bug c/109233] " ubizjak at gmail dot com
2023-03-21 14:05 ` ubizjak at gmail dot com
2023-03-22 10:27 ` ubizjak at gmail dot com
2023-03-22 10:38 ` [Bug c/109233] warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’ since r12-2591 jakub at gcc dot gnu.org
2023-03-22 10:40 ` [Bug c/109233] [12/13 Regression] " jakub at gcc dot gnu.org
2023-03-22 10:43 ` ubizjak at gmail dot com
2023-03-22 12:10 ` ubizjak at gmail dot com
2023-03-22 14:13 ` marxin at gcc dot gnu.org
2023-03-22 14:37 ` jakub at gcc dot gnu.org
2023-03-22 14:39 ` jakub at gcc dot gnu.org
2023-03-22 15:02 ` aldyh at gcc dot gnu.org
2023-03-22 17:16 ` amacleod at redhat dot com
2023-03-23 10:00 ` rguenth at gcc dot gnu.org
2023-03-27  6:13 ` ubizjak at gmail dot com
2023-05-08 12:26 ` [Bug c/109233] [12/13/14 " rguenth at gcc dot gnu.org

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).