From 304810208e50c2240283a5981258a39d41f0de23 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 19 Nov 2025 22:40:15 +1100 Subject: [PATCH] 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/ Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #17954 --- 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 7b7883a0c..134a76c09 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));