From 788c58ced532537b87f596355d3e9b6dec30e61a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 29 Jun 2023 13:17:38 -0400 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/linux/stp_tracepoint.c b/runtime/linux/stp_tracepoint.c index 1edac313c..508948dce 100644 --- a/runtime/linux/stp_tracepoint.c +++ b/runtime/linux/stp_tracepoint.c @@ -58,7 +58,7 @@ struct tracepoint_entry { struct tracepoint *tp; int refcount; struct list_head probes; - char name[0]; + char name[]; }; struct stp_tp_probe { -- 2.43.5