From nobody Wed Mar 02 05:55:45 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8B96319E05C6; Wed, 2 Mar 2022 05:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K7jyp0hhkz3PF5; Wed, 2 Mar 2022 05:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646200546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/qmXUhqleDXXFWK0tQjcil4K42VOdW0V2wFixYHei/Y=; b=yXqsJAmUwxjLl2M5HdgSanEiIWp7DqgfXVi13C8B34z/jkVc1cfbFDsjsKdaB0eA8rBfTj 0gdzxcmkouKqWWxVBO8MxmzFBOvX11fWTn80mL/lslsYTwv/gLF3NGnxI35eMz5J8jMZ1s A8RIUXfgbfLYSowEM8tjr6uiHzZQgh/ApOiQo+GFs+p/XfouRUNjvEGjjZsgE5pZOjTwpb Gl4A63m13Dp5qVFC1cRWydNgweXdzRkw3cksS+yMWNoYX/ofJ47JLsuSRSbTJpOyKnVgrh bvAAtXEJoNem+MdJzMHp+6LtAX1EwoT1nsxXkapkakOyhwUr4+qfaCt9YjiASA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25C11DB70; Wed, 2 Mar 2022 05:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2225tjtG075895; Wed, 2 Mar 2022 05:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2225tjUG075894; Wed, 2 Mar 2022 05:55:45 GMT (envelope-from git) Date: Wed, 2 Mar 2022 05:55:45 GMT Message-Id: <202203020555.2225tjUG075894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 369216b03983 - main - ath: fix older clang build. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 369216b039833d30b92cee44d448821ebd4077ce Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646200546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/qmXUhqleDXXFWK0tQjcil4K42VOdW0V2wFixYHei/Y=; b=s5e8bi+1m368eK/leGMa5bhYuBM2101tnC1ByZ+fwg2QH8d5flsVdNaCzijaB8ewxuna/B lnNMq0OAt+8fFrgo1sj/CzKDZh4vzxo0wpFbXYQUBDelAHwh7aewowIjrMG9mhE7mWZQ22 qdCgW7pkfBan81qU5/tshyEDK+o+XXTk39Yb0U6ofIGjBsHFY6T0TzpIIRrW5X1u+9tMnz GvpU152WzCsJ+2FWGuNvVljDa4pDgjG+Jivw8HYJZpbLfkCGgzwzqwtnVSjesfS+4jwyan gA9WN2N8pImfTaJpUBFapUJL/9EILik6VZaH9cYgFSMgqenGBln28q04pX2cIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646200546; a=rsa-sha256; cv=none; b=DxqCNypfXbLJvveC2wTjj/SlkcRftSWPgrgUQjxsI3AZRZYw9PJYRhwG01a6u8cF//ZnAs NNgl0wtSS2jTRtD1W+TX/TkBIhVAZdvT4R9A2eFgoUJZ+WoHj5jzuVUXSOjAQ7n+Ml6uBa 8eXGIB97eytBD5+PUazwsjuMjHdeUOmBDI2YSSPhkOtlvHGoP/J1glnd46eFYI3Q1CPHb3 p1buFUVJId6oKYER1MH6WSobM7PGn2xvXgQj62RY10r8eVVhG9w4lQHghPC50WbbHG7WQv 5LFwZ70zm/d64vc7ImvOkouNVeso1eMfS6BnyPjzr86nqhE0z+yrV848VTMyqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=369216b039833d30b92cee44d448821ebd4077ce commit 369216b039833d30b92cee44d448821ebd4077ce Author: Warner Losh AuthorDate: 2022-03-02 05:54:58 +0000 Commit: Warner Losh CommitDate: 2022-03-02 05:55:34 +0000 ath: fix older clang build. Define NO_WUNUSED_BUT_SET_VARIABLE for newer clang, and use it in ATH_C to account for different clang versions. Use it in Makefiles as well. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D34408 --- sys/conf/kern.mk | 6 +++++- sys/conf/kern.pre.mk | 2 +- sys/modules/ath/Makefile | 2 +- sys/modules/ath_ahb/Makefile | 2 +- sys/modules/ath_dfs/Makefile | 2 +- sys/modules/ath_hal/Makefile | 2 +- sys/modules/ath_hal_ar5210/Makefile | 2 +- sys/modules/ath_hal_ar5211/Makefile | 2 +- sys/modules/ath_hal_ar5212/Makefile | 2 +- sys/modules/ath_hal_ar5416/Makefile | 2 +- sys/modules/ath_hal_ar9300/Makefile | 2 +- sys/modules/ath_main/Makefile | 2 +- sys/modules/ath_pci/Makefile | 2 +- sys/modules/ath_rate/Makefile | 2 +- 14 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 06a0c1272704..c1228ed1bc6f 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -47,7 +47,7 @@ CWARNFLAGS+= -Wno-error=unused-but-set-variable .if ${COMPILER_TYPE} == "gcc" # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. -NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable +NO_WUNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable CWARNEXTRA?= -Wno-error=address \ -Wno-error=aggressive-loop-optimizations \ -Wno-error=array-bounds \ @@ -90,6 +90,10 @@ CWARNFLAGS+= -Wno-format-zero-length FORMAT_EXTENSIONS= -Wno-format .elif ${COMPILER_TYPE} == "clang" FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ +# Only newer versions of clang have -Wno-unused-but-set-variable +.if ${COMPILER_VERSION} >= 130000 +NO_WUNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable +.endif .else FORMAT_EXTENSIONS= -fformat-extensions .endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index f36613f8a609..3ba837d9de11 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -263,7 +263,7 @@ ZFS_RPC_C= ${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${.IMPSRC} ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC} # ATH driver -ATH_CFLAGS= -I${SRCTOP}/sys/dev/ath -Wno-unused-but-set-variable +ATH_CFLAGS= -I${SRCTOP}/sys/dev/ath ${NO_WUNUSED_BUT_SET_VARIABLE} ATH_C= ${CC} -c ${CFLAGS} ${WERROR} ${ATH_CFLAGS} ${.IMPSRC} # Special flags for managing the compat compiles for DTrace diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile index 5697a6464e15..c312058a4abf 100644 --- a/sys/modules/ath/Makefile +++ b/sys/modules/ath/Makefile @@ -42,4 +42,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_ahb/Makefile b/sys/modules/ath_ahb/Makefile index ee2fe2adb5da..02278eadea2b 100644 --- a/sys/modules/ath_ahb/Makefile +++ b/sys/modules/ath_ahb/Makefile @@ -40,4 +40,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_dfs/Makefile b/sys/modules/ath_dfs/Makefile index db49f6b20109..93c6b64e23ce 100644 --- a/sys/modules/ath_dfs/Makefile +++ b/sys/modules/ath_dfs/Makefile @@ -46,4 +46,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal/Makefile b/sys/modules/ath_hal/Makefile index 92beae8420b6..e21698918e76 100644 --- a/sys/modules/ath_hal/Makefile +++ b/sys/modules/ath_hal/Makefile @@ -47,4 +47,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ EXPORT_SYMS= YES CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal_ar5210/Makefile b/sys/modules/ath_hal_ar5210/Makefile index f327b980ef5b..57302b01bdf3 100644 --- a/sys/modules/ath_hal_ar5210/Makefile +++ b/sys/modules/ath_hal_ar5210/Makefile @@ -52,4 +52,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal_ar5211/Makefile b/sys/modules/ath_hal_ar5211/Makefile index 19788ab835fa..29f03932f640 100644 --- a/sys/modules/ath_hal_ar5211/Makefile +++ b/sys/modules/ath_hal_ar5211/Makefile @@ -54,4 +54,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal_ar5212/Makefile b/sys/modules/ath_hal_ar5212/Makefile index 93b47315ba4c..53ab389ba4e0 100644 --- a/sys/modules/ath_hal_ar5212/Makefile +++ b/sys/modules/ath_hal_ar5212/Makefile @@ -59,4 +59,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal_ar5416/Makefile b/sys/modules/ath_hal_ar5416/Makefile index a3dbbd041cfc..7169a92c429f 100644 --- a/sys/modules/ath_hal_ar5416/Makefile +++ b/sys/modules/ath_hal_ar5416/Makefile @@ -90,4 +90,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_hal_ar9300/Makefile b/sys/modules/ath_hal_ar9300/Makefile index 7d709d319a85..1145777f1838 100644 --- a/sys/modules/ath_hal_ar9300/Makefile +++ b/sys/modules/ath_hal_ar9300/Makefile @@ -57,4 +57,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ # AR9300 HAL build overrides, as there's still some code to tidy up CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_main/Makefile b/sys/modules/ath_main/Makefile index 7971df14c905..4cf55d42fc92 100644 --- a/sys/modules/ath_main/Makefile +++ b/sys/modules/ath_main/Makefile @@ -50,4 +50,4 @@ CFLAGS+= ${ATH_CFLAGS} # XXX Work around clang warnings, until maintainer approves fix. CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UNINITIALIZED} -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_pci/Makefile b/sys/modules/ath_pci/Makefile index 7ed67fffca65..a5a2d87925ca 100644 --- a/sys/modules/ath_pci/Makefile +++ b/sys/modules/ath_pci/Makefile @@ -40,4 +40,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} diff --git a/sys/modules/ath_rate/Makefile b/sys/modules/ath_rate/Makefile index c6be915bc744..b36c1b426d30 100644 --- a/sys/modules/ath_rate/Makefile +++ b/sys/modules/ath_rate/Makefile @@ -56,4 +56,4 @@ CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .include -CWARNFLAGS+= -Wno-unused-but-set-variable +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}