From nobody Wed Mar 22 22:28:36 2023 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 4Phjmh41GTz41P4J; Wed, 22 Mar 2023 22:28:36 +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 4Phjmh3Q4Fz3hwl; Wed, 22 Mar 2023 22:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524116; 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=kfyKNh8NNc9lN1xC2Bj7Ps27P+hgua3dFjsGDtbd+vg=; b=AblONOiNAxaKGOsAY+uYjb97AWF1+vXsk1FBfPyS5DhS1K2Fm3kAsHxn/1IJCRC4sFMc/F 0bWu/eLhToLjf1OsF5+138TIDyiTp1CODXq4wnTBHbVDmPc3QikgaltBua799EfvDIoVl7 b2iVTuvlkm10mIcGRReSk6hWfHLqGeZysTF0sJjjFLSU42cxHhdqIewVRKYc8kHTF19dLj GPYHWBBn76kJjYebQtAN1GSwPe+aP1f/2HNcS5rlwaaGCCJ2Rtuwkr4YADG6dG7Tp85qhI ORMDB+XJUNWnIW+KL6JsejwaTAXNFI4rHXYMHiafz1lhNHPIhHr6puL82juL6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524116; 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=kfyKNh8NNc9lN1xC2Bj7Ps27P+hgua3dFjsGDtbd+vg=; b=rxorbPhxkQDIPnBWpNiIvS99Ff1rcRqujryIbBlfDFLPfLdrwnnyL5ohtCXDbpdDNCykwc /7vv//WH6fQ9S0EYeg60mOJTWxPiu3mDTfDHBGs0uk9gYcea6Mkjnw88SP4L86Kx+L4MEk mWnoqHI0n2VBOFuWkMo6AcadmkNKqnT0EkUT6EbG/bcvru4vldkTxBCGpiKHvVRpy10SB+ 3rfdscL0auUboUSZPNSoAHE3VQIcKTI17w0GMgxy1IO34Sf1K6CtNofBUb7K1hmYayizfd pCJWMaVlPgrQApZYyBphHLm5H3ar+i71K1jU4s4i1Ex4NwhSr1lqOJt5YQF6vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679524116; a=rsa-sha256; cv=none; b=cvul9O8dmPPRphcfuUq5NKofE5pQwHsap7E9PYxtWvdErxvADW7SxoZzrcFuHph+snTs8J NaGGP3KhzBSI1DFSOpZhVXapPwx4ksQuL3Wuur4Iv0UShCqjrV3xh+tcfhwwuRAqcLDyKG YogLAwu0DRg4CE3q8hCyMaQ3BCezLSvLf1uXkNupi6LwX0B1ygRk0pDoCPADighu8DdOf/ PUDuuVguUCLbBkJek2b/qZpk4oJI9RITwm4IienrcP5MZaKrfxVycjPVz5aXqAbWDV9asW 0a6GPF3twwVQyeFcL6WI6afP1bIMCi9I0atOXL715jLWTyn9/rRntpG6exVh1Q== 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 4Phjmh2VGWz1BCd; Wed, 22 Mar 2023 22:28:36 +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 32MMSans001786; Wed, 22 Mar 2023 22:28:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32MMSa4f001785; Wed, 22 Mar 2023 22:28:36 GMT (envelope-from git) Date: Wed, 22 Mar 2023 22:28:36 GMT Message-Id: <202303222228.32MMSa4f001785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 51666ee9660e - stable/12 - Disable -Wreturn-type on GCC. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 51666ee9660e12f3e38a43b54fa879c680b0eafa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=51666ee9660e12f3e38a43b54fa879c680b0eafa commit 51666ee9660e12f3e38a43b54fa879c680b0eafa Author: John Baldwin AuthorDate: 2022-02-14 19:48:47 +0000 Commit: John Baldwin CommitDate: 2023-03-22 19:22:23 +0000 Disable -Wreturn-type on GCC. GCC is more pedantic than clang about warning when a function doesn't handle undefined enum values (see GCC bug 87950). Clang's warning gives a more pragmatic coverage and should find any real bugs, so disable the warning for GCC rather than adding __unreachable annotations to appease GCC. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D34147 (cherry picked from commit 2f6a842484675bb8fe9fafd40d90c06f13e02403) --- share/mk/bsd.sys.mk | 6 ++++++ sys/conf/kern.mk | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index f228984719c7..7211b54c1804 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -196,6 +196,12 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ -Wno-error=stringop-truncation .endif +.if ${COMPILER_TYPE} == "gcc" +# GCC produces false positives for functions that switch on an +# enum (GCC bug 87950) +CWARNFLAGS+= -Wno-return-type +.endif + # How to handle FreeBSD custom printf format specifiers. .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 67656914dd1d..0f311fba2b23 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -89,7 +89,11 @@ CWARNEXTRA?= -Wno-uninitialized # the few files that are already known to generate cast-qual warnings. NO_WCAST_QUAL= -Wno-cast-qual .endif -.endif + +# GCC produces false positives for functions that switch on an +# enum (GCC bug 87950) +CWARNFLAGS+= -Wno-return-type +.endif # gcc # This warning is utter nonsense CWARNFLAGS+= -Wno-format-zero-length