Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1390168lqp; Mon, 15 Apr 2024 05:23:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5Otg4pz7tpcxzy0vS/yVqp+T66q3lJ2IStSFj/JYt0ffYcIBHuWccVmWGRoQ6lAsCDCOuOjeqHsts78OQKj1BIti6KgYnjrpQOT7SIQ== X-Google-Smtp-Source: AGHT+IFvMny589/H1rTFHYe9WIdFmZNUvvUY0C98TTKZ413iw/esirDQF4kV1bFexV/98BNkbUPn X-Received: by 2002:a17:90a:38c6:b0:2a4:6ce7:37ad with SMTP id x64-20020a17090a38c600b002a46ce737admr12798636pjb.5.1713183794892; Mon, 15 Apr 2024 05:23:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713183794; cv=pass; d=google.com; s=arc-20160816; b=rAF4IIau7Zlo+h6tQeVyAiiCZoJAp6VvNfqCPSZSZxyI73R77FINFnwZuTUHL+NiKQ oQ3hK7SSpf5UmflH9nj6rSV2wnkqftUBeslxyEZjEyY3tWcWRQ6lisKjnvqTwZuvvxfc YaDt1Lc06xHawpxYe1BVdTbpbSqiHSSYfFyFG6UqrRUN/zAjci4VXW3tLgv2LEal1yxG Upx3XcD54hHykRmmBk+yZjMlUFU96VYzW3sCGrdX3/m+BzgQbAueACevm6wTers+t16G zx/Yoh/fjx8uPAFbIu3j9inPtiJ4B1DLHa+6uEuIVuBwnhjGNgvcoZ+fQYtJrBGRe++q 7XYQ== 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=3hcw6sIsFT7LpNM91h6PZkgNU3yYFzwK/ZD6WVCqjS8=; fh=8mZP3M6PAgp/PjjZstGz5vfdgfC3/JFy0A6tayPaJ0U=; b=qFUBYm362ryFSPp2x7enPkeno+iB5PNiO8jX2dPoHu9HSnXQNegh2YZwAcCWusLkvd pNz928rHR6fDHl6YdfV0HenrMAm3Ws1XZAtQdp4JXOL4UKae5FiiXxOdujm248+qk5/C F6u/cvhpJFjnGuWdOe90dnzfH4vnTWPNeROkaFxJvSw9C1/UvkaHAOmpXzKauYG57Enz gn+zgQCVdSmT9R9GDkg8SBNYoEhsDzxetDpBxsjQy9Y17vaN2BJqZbQYI008ntNfFurL h760qlBBoZQ9SFuPn185q+8NAZhX/s7txJNfsVeVF+PE0XSZfN7AFEQQZGJ1afHj//ne LJEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rSrP0dWT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q13-20020a17090a2dcd00b002a52f22f658si7700314pjm.126.2024.04.15.05.23.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:23:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rSrP0dWT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145055-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A5AC7B2225F for ; Mon, 15 Apr 2024 12:21:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52BBA6DD1D; Mon, 15 Apr 2024 12:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rSrP0dWT" 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 799A16D1B5; Mon, 15 Apr 2024 12:20:48 +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=1713183648; cv=none; b=U98HmTXd72ftqLnemWmStu+D6GsnXoKgED/MvbYiqRs1dFkEthm9TH4e9DjwZhIa/1U0urojYNGetufgY8CIsJ1ONC2JxS7DqmN36yhzgQwqPgzPrGxmd4bhfSp+M/Xpb471A9duaOPLrzXXH4WaU5Xu/y6OmvofVQQBg1j8NrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713183648; c=relaxed/simple; bh=9rWj91Ui3yXdrYdI/xJnn3eqhuI+T44/0BgWu41vBio=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mjjR0whXUB7c3Kru21/N4HPBDOh4T//jYlu8zQt8GM+x3uv9WeWAVKEd6pklE+RCIYTPO9GpjEoVHR0eS5XHwG3x/OG7ShNi5GTyd4YtDUKeJnmmTzVGYvmRj0mMuOo6hOfLraQ1vxtg9N77rKnEn/1c3p0P043mwMgSR+1NghI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rSrP0dWT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28CCFC4AF07; Mon, 15 Apr 2024 12:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713183648; bh=9rWj91Ui3yXdrYdI/xJnn3eqhuI+T44/0BgWu41vBio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSrP0dWTMu2/IdKx7qvepoKhAnZ7EOl7KGN9Nh/Hq9qybD2qbUBwiDqqbEiLlvdJH bBzACt7BoWDybOEUMOq4C3MJcjoCuhq5567XE1yXGNv1DkpBds7ZzvAnwaHzrFjXeH /9CA62207RipTTXueygEh1xelWDTACJah/x/3AbQ6R8xFAZ4OLJK/EI94lW0VP0Rz6 NJrXuFN6CYP1YHqq9NbxyrlAKoJaA0gPVKh/xod14ayxUkh0YdqhVQ5gpx9YOMcLse jd0WyIBPS8hpm1bPZqPHLKyMH7Q13Avdjn3f8aGR8urL4iOIkfyRCqZvN6iFQT99CN g5bh1Nfz7PRWg== From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] [v3] kbuild: turn on -Wextra by default Date: Mon, 15 Apr 2024 14:20:32 +0200 Message-Id: <20240415122037.1983124-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240415122037.1983124-1-arnd@kernel.org> References: <20240415122037.1983124-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. Acked-by: Nathan Chancellor 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