This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/25097] new -Warray-bounds with GCC 10


https://sourceware.org/bugzilla/show_bug.cgi?id=25097

--- Comment #1 from Martin Sebor <msebor at gmail dot com> ---
The GCC patch has just landed.  It issues the same warnings, except those in
libc-tls.c and rtld.c are reported under the new -Wzero-length-bounds option
designed to detect accesses to interior zero-length array elements that overlap
subsequent members but that are otherwise not known to be out of the bounds of
the referenced object (it it's known).  These issues are classified separately
from -Warray-bounds so they can be suppressed independently, for example while
code is being cleaned up.

libc-tls.c:209:30: warning: array subscript 1 is outside the bounds of an
interior zero-length array ‘struct dtv_slotinfo[0]’ [-Wzero-length-bounds]
  209 |   static_slotinfo.si.slotinfo[1].map = main_map;
In file included from ../sysdeps/x86/ldsodefs.h:64,
                 from ../sysdeps/gnu/ldsodefs.h:46,
                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
                 from libc-tls.c:21:
../sysdeps/generic/ldsodefs.h:423:7: note: while referencing ‘slotinfo’
  423 |     } slotinfo[0];
      |       ^~~~~~~~
rtld.c:1016:27: warning: array subscript ‘cnt’ is outside the bounds of an
interior zero-length array ‘struct auditstate[0]’ [-Wzero-length-bounds]
 1016 |    GL(dl_rtld_map).l_audit[cnt].cookie = (intptr_t) &GL(dl_rtld_map);
In file included from ../include/dlfcn.h:4,
                 from rtld.c:20:
../include/link.h:335:7: note: while referencing ‘l_audit’
  335 |     } l_audit[0];
      |       ^~~~~~~

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]