public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109215] New: warning: array subscript 0 is outside the bounds of an interior zero-length array ‘struct lock_class_key[3]’
@ 2023-03-20 14:26 ubizjak at gmail dot com
  2023-03-20 14:27 ` [Bug c/109215] " ubizjak at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2023-03-20 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109215
           Summary: warning: array subscript 0 is outside the bounds of an
                    interior zero-length array ‘struct lock_class_key[3]’
           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: ---

The linux kernel compile fails with gcc-13 in super.c with:

fs/super.c: In function ‘alloc_super.isra’:
fs/super.c:234:21: error: array subscript 2 is outside the bounds of an
interior zero-length array ‘struct lock_class_key[3]’
[-Werror=zero-length-bounds]
  234 |                 if (__percpu_init_rwsem(&s->s_writers.rw_sem[i],
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  235 |                                         sb_writers_name[i],
      |                                         ~~~~~~~~~~~~~~~~~~~
  236 |                                         &type->s_writers_key[i]))
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/highmem.h:5,
                 from ./include/linux/bvec.h:10,
                 from ./include/linux/blk_types.h:10,
                 from ./include/linux/blkdev.h:9,
                 from fs/super.c:26:
./include/linux/fs.h:2211:31: note: while referencing ‘s_writers_key’
 2211 |         struct lock_class_key s_writers_key[SB_FREEZE_LEVELS];
      |                               ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

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

end of thread, other threads:[~2023-03-21 10:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 14:26 [Bug c/109215] New: warning: array subscript 0 is outside the bounds of an interior zero-length array ‘struct lock_class_key[3]’ ubizjak at gmail dot com
2023-03-20 14:27 ` [Bug c/109215] " ubizjak at gmail dot com
2023-03-20 15:11 ` [Bug tree-optimization/109215] [13 Regression] wrong " pinskia at gcc dot gnu.org
2023-03-20 15:11 ` pinskia at gcc dot gnu.org
2023-03-20 16:40 ` jakub at gcc dot gnu.org
2023-03-20 17:20 ` jakub at gcc dot gnu.org
2023-03-20 17:42 ` jakub at gcc dot gnu.org
2023-03-20 18:51 ` jakub at gcc dot gnu.org
2023-03-21  8:11 ` rguenth at gcc dot gnu.org
2023-03-21 10:07 ` cvs-commit at gcc dot gnu.org
2023-03-21 10:07 ` jakub 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).