From ab9cbbd421450a7da97b851b34ff0338d540c810 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 19 Nov 2025 22:37:49 +1100 Subject: [PATCH 1/3] Linux: bump -std to gnu11 Linux switched from -std=gnu89 to -std=gnu11 in 5.18 (torvalds/linux@e8c07082a810f). We've always overridden that with gnu99 because we use some newer features. More recent kernels are using C11 features in headers that we include. GCC generally doesn't seem to care, but more recent versions of Clang seem to be enforcing our gnu99 override more strictly, which breaks the build in some configurations. Just bumping our "override" to match the kernel seems to be the easiest workaround. It's an effective no-op since 5.18, while still allowing us to build on older kernels. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris --- module/Kbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Kbuild.in b/module/Kbuild.in index 95313c984178..e653908efc9c 100644 --- a/module/Kbuild.in +++ b/module/Kbuild.in @@ -2,7 +2,7 @@ # first. This ensures its module initialization function is run before # any of the other module initialization functions which depend on it. -ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement +ZFS_MODULE_CFLAGS += -std=gnu11 -Wno-declaration-after-statement ZFS_MODULE_CFLAGS += -Wmissing-prototypes ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ @KERNEL_NO_FORMAT_ZERO_LENGTH@ From 079efe72f616ff940dcf5641a03197a99162a438 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 19 Nov 2025 22:40:15 +1100 Subject: [PATCH 2/3] zvol_id: make array length properly known at compile time Using strlen() in an static array declaration is a GCC extension. Clang calls it "gnu-folding-constant" and warns about it, which breaks the build. If it were widespread we could just turn off the warning, but since there's only one case, lets just change the array to an explicit size. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris --- udev/zvol_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev/zvol_id.c b/udev/zvol_id.c index 7b7883a0c74f..134a76c09f6a 100644 --- a/udev/zvol_id.c +++ b/udev/zvol_id.c @@ -67,7 +67,7 @@ main(int argc, const char *const *argv) return (1); } - char zvol_name[MAXNAMELEN + strlen("-part") + 10]; + char zvol_name[MAXNAMELEN+15]; if (ioctl(fd, BLKZNAME, zvol_name) == -1) { fprintf(stderr, "%s: BLKZNAME: %s\n", dev_name, strerror(errno)); From 8fbbeab944b90de1c6f57398d116d06e5d073b5e Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 19 Nov 2025 22:46:30 +1100 Subject: [PATCH 3/3] config/kmap_atomic: initialise test data 6.18 changes kmap_atomic() to take a const pointer. This is no problem for the places we use it, but Clang fails the test due to a warning about being unable to guarantee that uninitialised data will definitely not change. Easily solved by forcibly initialising it. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris --- config/kernel-kmap-atomic-args.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/kernel-kmap-atomic-args.m4 b/config/kernel-kmap-atomic-args.m4 index 1172505afc68..cedadf3b3d8b 100644 --- a/config/kernel-kmap-atomic-args.m4 +++ b/config/kernel-kmap-atomic-args.m4 @@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS], [ ZFS_LINUX_TEST_SRC([kmap_atomic], [ #include ],[ - struct page page; + struct page page = {}; kmap_atomic(&page); ]) ])