Date: Mon, 26 Jan 2026 08:41:49 +0000 From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5118ca75f3c4 - stable/14 - vchiq: fix build with clang 21 Message-ID: <697728cd.26bea.57bebccc@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=5118ca75f3c4b9d6aa279575313dc3a74efc336f commit 5118ca75f3c4b9d6aa279575313dc3a74efc336f Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-01-16 14:02:25 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-01-26 08:30:22 +0000 vchiq: fix build with clang 21 When compiling vchiq with clang 21, the following -Werror warning is produced: sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c:728:27: error: default initialization of an object of type 'VCHIQ_QUEUE_MESSAGE32_T' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] 728 | VCHIQ_QUEUE_MESSAGE32_T args32; | ^ sys/contrib/vchiq/interface/vchiq_arm/vchiq_ioctl.h:151:40: note: member 'elements' declared 'const' here 151 | const /*VCHIQ_ELEMENT_T * */ uint32_t elements; | ^ While the warning is formally correct, the 'args32' object is immediately initialized after its declaration. Therefore, suppress the warning. MFC after: 3 days (cherry picked from commit b39662fc388678db2b7b5fa3c900205252d15b3b) --- sys/arm/broadcom/bcm2835/files.bcm283x | 2 +- sys/conf/files.arm64 | 2 +- sys/conf/kern.mk | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/files.bcm283x b/sys/arm/broadcom/bcm2835/files.bcm283x index 44976f34d35a..cda5a28d3b76 100644 --- a/sys/arm/broadcom/bcm2835/files.bcm283x +++ b/sys/arm/broadcom/bcm2835/files.bcm283x @@ -32,7 +32,7 @@ contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq \ contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq \ compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_arm.c optional vchiq \ - compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" + compile-with "${NORMAL_C} -Wno-unused ${NO_WDEFAULT_CONST_INIT_FIELD_UNSAFE} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_connected.c optional vchiq \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_core.c optional vchiq \ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index cfb4bf358f45..1b7566deb28a 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -520,7 +520,7 @@ contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq soc_brcm_bcm2837 \ compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_arm.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" + compile-with "${NORMAL_C} -Wno-unused ${NO_WDEFAULT_CONST_INIT_FIELD_UNSAFE} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_connected.c optional vchiq soc_brcm_bcm2837 \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_core.c optional vchiq soc_brcm_bcm2837 \ diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index e37665ac374c..f0c35bdeaa1f 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -37,6 +37,9 @@ NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical NO_WSTRICT_PROTOTYPES= -Wno-strict-prototypes NO_WDEPRECATED_NON_PROTOTYPE= -Wno-deprecated-non-prototype .endif +.if ${COMPILER_VERSION} >= 210000 +NO_WDEFAULT_CONST_INIT_FIELD_UNSAFE= -Wno-default-const-init-field-unsafe +.endif # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?697728cd.26bea.57bebccc>
