]> sourceware.org Git - systemtap.git/commit
Fedora rawhide kernels are now flagging use of zero length arrays
authorWilliam Cohen <wcohen@redhat.com>
Thu, 29 Jun 2023 17:17:38 +0000 (13:17 -0400)
committerWilliam Cohen <wcohen@redhat.com>
Thu, 29 Jun 2023 17:17:38 +0000 (13:17 -0400)
commit788c58ced532537b87f596355d3e9b6dec30e61a
tree365d8abad992d4784faff3f8b810de7a1d66bd20
parentdf9f03f3e55fdcece3c8069040dd2dce48694ed9
Fedora rawhide kernels are now flagging use of zero length arrays

The kernel has switched from using zero length arrays to flexible
arrays.  The kernel compiles have gotten picker and now flags accesses
beyond the end of end of arrays when possible.  When trying to run the
testsuite on Fedora rawhide got the following error due to a zero
length array:

In file included from /tmp/stapaBPtwB/stap_6b7e9ee7df4a3f6e4cfbffb7f92d8405_1736_src.c:543:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c: In function 'add_tracepoint':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c:148:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  148 |                 if (!strcmp(name, e->name)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c:61:14: note: source object 'name' of size 0
   61 |         char name[0];
      |              ^~~~

Switched the zero length array in the struct to a flexible array to
eliminate the issue.
runtime/linux/stp_tracepoint.c
This page took 0.025545 seconds and 5 git commands to generate.