Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3384516lqp; Tue, 26 Mar 2024 07:52:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQR2VzxJAuti0a71LI+CGJJ9QbN1S323L5QUQuJQpTlGuPfXrkq01U9SqpxX/3BGX02QBox7WVXCEKTxOTX+yQkHEcO8OEju7SFQ5PsQ== X-Google-Smtp-Source: AGHT+IFRIGwK5KDfeNmQVqgI/Mt/bYTiTPf7VKD6/Xu6SCABG0HwaTaQSIxgkqcH/L55/KdYL2Ry X-Received: by 2002:a50:8706:0:b0:56c:19d2:85b2 with SMTP id i6-20020a508706000000b0056c19d285b2mr1214273edb.35.1711464740907; Tue, 26 Mar 2024 07:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711464740; cv=pass; d=google.com; s=arc-20160816; b=t2H7pRsuwH0FKGIzNOtL0d+W5f6TNP89oLRRh2MxlrDfNbwrjsOgkYBOJ/D+JtsAoG PafQ6avG1PHL4bc5UgP5q6pBFLAuQSswGi3stmHC6JtDwXaSAcTzDmKmObYdU4HNFfF6 tRGNxOjqBCrkDSEV5XzKH66AKbEG9fOgWSSGnxNdqeCQmfI9Orj6lY0bD56Dnlewk4Rb 9sBS7CKGLjB9FsHPiq8FCPDAX7OhPearcd/6VzJShBKae2pyf7ya4TNLz0V2hsHdVko/ yRmy28hCsmoR424O2O9qJwpv/xDQ1jkO5prYjechpStbm29jKS1h+ySIcVz7cdX67Kyu E6Gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=oF5hrV9Y/4jMOGlbrLqJaMDqwl368+HnFEeAW5eg2zI=; fh=Nyew/h7v5TQjkq8FQ4xznOaoQ0ssQE6qFpB17sc1BII=; b=ksxTbJWnE/pCy7xa+m+wMNFh0+FrLArpP74YJoVlvEZrSawEIJ01qbRTGm8GoJVKbW l+7nsTtYQq4enimP15Atj/QmxDzc8jmG9pCHG9AEQgKW/FtMu2mtvBDrA5v+HMsOmSoA fY2PJpHzKkT2l5rrL8UtscqxGVtJVaL9Ngpq1rBsgsUYQo3iTOnm+uHiQY6Z66+LSUDM A2EgjO/d82RMO+4WeAc8QlkuO190QIwBxNXFoh5YWP2AOKPnvCIt5ClitmbdmtmwpEG3 axNLcd9UkwptIWZNTWtGqJT25BEMZOyj3g9zUwYasIaq8Z9rpcD0LZbl4a44vbFf+ahc wz9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KEplcAB3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o14-20020aa7c7ce000000b0056b8429cf93si3611943eds.385.2024.03.26.07.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 07:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KEplcAB3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A22AD1F3577B for ; Tue, 26 Mar 2024 14:52:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B2D613C673; Tue, 26 Mar 2024 14:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KEplcAB3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BFB213C803; Tue, 26 Mar 2024 14:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711464720; cv=none; b=G7lRe+1PltdlKP24l4bkJz+rLaXFDwfR26CMX8/7rFwsTG2yXnMLABY8s1dVOHwyKBSy0z3iMkvZKAfIrRp8gkDxT3f7wY/splv0eTO2+nG2ZvJb/RWk+TWiDXXyUhvg0cH+kixDhl/3t4d9yo+VPLf7cvpEC9DpE8iaWfaC0p4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711464720; c=relaxed/simple; bh=XGdU46c4ZSunIoursaUt7noQnOr0Myyw+lOAyQpQkBw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TN3YNmbY1O00A5cVwzS4chuDC3byeuUtP3okm3WMF7VwVmsWgBku7iiFLg22iY6Cq3+oqMOj6lZ9cajwaRqL26+vMDAh/q4HMF1mAv1UeRoY/IY1piBlaOO6HrnADluD+bjC7slRjtvAU6Wh/SNgLz9cKUGvAcu9b/F0VsV5IbU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KEplcAB3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FEB3C433C7; Tue, 26 Mar 2024 14:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711464719; bh=XGdU46c4ZSunIoursaUt7noQnOr0Myyw+lOAyQpQkBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KEplcAB3dVQVfWrxKSNiyps8CnbPXF8ZouKBwgLGsA+aAD8sRdfi/MBFwH+sACeN3 pEsjjmI8m2F3mofcoUWPYJCP+tMjg+X4ZBAqc6B8yp+Qn32xoZu448apWzITzuP4ts shDbACpbhvC2Rj3GlZcrD6dF71bFVCpwvnSmn8dcH42J01dbXbYg/grh13jQYRLUxK KRbK8KwCOGR/cDHWRVVl+C21EomhsY65PF6x/YeyME0cLrTrod2C1eOQtRgUJVY3tb tfZFIo1fZQW4KhlL+pnJZ0nx5FnyMRVKz7C65TMUhQrv8lHZRK5alHUaNi8yL0ydkB xJd01psTMWk7A== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org, Masahiro Yamada Cc: Nicolas Schier , Nathan Chancellor , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 03/12] kbuild: turn on -Wextra by default Date: Tue, 26 Mar 2024 15:51:28 +0100 Message-Id: <20240326145140.3257163-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326144741.3094687-1-arnd@kernel.org> References: <20240326144741.3094687-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann The -Wextra option controls a number of different warnings that differ slightly by compiler version. Some are useful in general, others are better left at W=1 or higher. Based on earlier work, the ones that should be disabled by default are left for the higher warning levels already, and a lot of the useful ones have no remaining output when enabled. Move the -Wextra option up into the set of default-enabled warnings and just rely on the individual ones getting disabled as needed. The -Wunused warning was always grouped with this, so turn it on by default as well, except for the -Wunused-parameter warning that really has no value at all for the kernel since many interfaces have intentionally unused arguments. Signed-off-by: Arnd Bergmann --- scripts/Makefile.extrawarn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index c5af566e911a..c247552c192c 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -82,12 +82,14 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) # Warn if there is an enum types mismatch KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) +KBUILD_CFLAGS += -Wextra +KBUILD_CFLAGS += -Wunused + # # W=1 - warnings which may be relevant and do not occur too often # ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) -KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter KBUILD_CFLAGS += $(call cc-option, -Wrestrict) KBUILD_CFLAGS += -Wmissing-format-attribute KBUILD_CFLAGS += -Wold-style-definition @@ -190,6 +192,7 @@ else # The following turn off the warnings enabled by -Wextra KBUILD_CFLAGS += -Wno-sign-compare +KBUILD_CFLAGS += -Wno-unused-parameter endif -- 2.39.2