git: 2ec6a2e5f011 - main - iwlwifi: fix the gcc build

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Thu, 06 Nov 2025 21:43:16 UTC
The branch main has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ec6a2e5f01120ea8d4e667e7773d8b140e40c75

commit 2ec6a2e5f01120ea8d4e667e7773d8b140e40c75
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2025-11-04 22:52:41 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2025-11-06 21:19:27 +0000

    iwlwifi: fix the gcc build
    
    - Only apply the previously added CWARNFLAGS to `drv.c` instead of the
      whole module.
    - Only apply `-Wno-initializer-overrides` to CWARNFLAGS in the clang
      scenario as it's not supported with gcc.
    
    This fixes building the module with gcc and avoids accidentally
    introducing tech debt with the module, in the event other issues are
    accidentally introduced.
    
    MFC after:      3 days
    Fixes:          6b627f8858 ("iwlwifi: update Intel's mvm/mld drivers")
    Differential Revision:  https://reviews.freebsd.org/D53591
---
 sys/modules/iwlwifi/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile
index 5d4830537a0b..6fe64a611900 100644
--- a/sys/modules/iwlwifi/Makefile
+++ b/sys/modules/iwlwifi/Makefile
@@ -91,7 +91,7 @@ CFLAGS+=	-DCONFIG_IWLWIFI_DEVICE_TRACING=1
 #CFLAGS+=	-DCONFIG_THERMAL=1
 #CFLAGS+=	-DCONFIG_EFI=1
 
-# XXX-BZ how to do this just for pcie/drv.c (and gcc vs. clang)?
-CFLAGS += -Wno-override-init -Wno-initializer-overrides
+CWARNFLAGS.clang.drv.c+=	-Wno-initializer-overrides
+CWARNFLAGS.drv.c+=		-Wno-override-init ${CWARNFLAGS.${COMPILER_TYPE}.${.IMPSRC:T}}
 
 .include <bsd.kmod.mk>