Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp133082lqp; Thu, 4 Apr 2024 08:51:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbs9iv+mcLgAayc92d9DUYmkKlx04suGUkeLgrNEamHYXgWYkbqipPgCSaE7pH9yDpg3LkPgazeHMFjAvTTDU4N28HbuioxstHGCHRpA== X-Google-Smtp-Source: AGHT+IH7I28Xy89JzhdnBqFz4AmGSvZm0B/Jfo9zrrhlsrBlsBga7RUucl2i5mqrpapez0cyRaAj X-Received: by 2002:a05:6218:260e:b0:184:c1b:4136 with SMTP id oy14-20020a056218260e00b001840c1b4136mr2001641rwc.6.1712245876673; Thu, 04 Apr 2024 08:51:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712245876; cv=pass; d=google.com; s=arc-20160816; b=H4otQ4SqE8WFOlkMPlHF674T7W3z/Eoi8EMUaAwGBkg7mV2q4YPaLpAPfg3FtSfuld BrEsmizQx+EhkoSUptOF+JQKPTc3GgKaD8rGaYReTL7mtnj3ujwv8gmPkEoZa/nNy/Pj 3UpQFsT4D4LydoBlT3Sl9bMuldBjTZJFiGsCwKARVbgZ2ZqYOEoNnbgHXma0gENIoYh5 V1mIFegF1DsgxGB5Y7A+txrJS367Dufgl7ldgkncwW9BkBe6QhBWU4lzO8klzFdau7/q 5TQZu6F5cNZBxX4rdO+mM0JFQDDDgTjrUdi7wSxdMWpGNsFb46X2PsjLArtlu93iFsOM SR9Q== 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=p77RUiu4Euj6pIFeLjlc9apoj3ZrCp1+y3jQkRgmkYo=; b=lAoMzZ7gzT+YkWogZhxrWfGY3qZsGb9b1g02OMAIi7fH4uwtkSb1PboMu5+8vkCxWs iqrBQB7jXiTLfNAgTdtCpiVbACf9Mc9mY5O284ujrtGK48nrJ0mcKLnUZJ72lqqU89IQ 9qwcHAzW9rgBEZEkyZ9ZsTgMsV44Vm4uJKDsnMEYg+NnaYozAyDV+wo0L4HF639hwzDP k2fkda9lVUUq/5xnDqITi2YKWgtd1QDnTznBfItgUSvncPzE87KqZun2SQl5vPE5x34i fk6cYAwggRLmoS005DDs80QBNOR4bbcJy9l3JSf3G3DOVtHrQUhpKFmkaJ97pmmM6dFc fL6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=glTE2pBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-131705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131705-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. [147.75.48.161]) by mx.google.com with ESMTPS id a19-20020a637053000000b005d8b59b8da3si15221012pgn.839.2024.04.04.08.51.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 08:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=glTE2pBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-131705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131705-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 A5C34B2F985 for ; Thu, 4 Apr 2024 15:20:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDCD112D75B; Thu, 4 Apr 2024 15:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="glTE2pBD" 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 0F226745C4; Thu, 4 Apr 2024 15:17:37 +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=1712243858; cv=none; b=LR6mrTzFgvrYWfbBD4cxWwsOt9Btn0g3LXMwsXbCVefakk8AG+q8+UsLJITMRxQN0Wqv/lwAzpCsD6+EjXppEFncHzg4FI02yjxQVq/SyTsK42/zLmcwWt/yRtdXiJXyJALs7mZb2K/cFz3JjhGrOJXqgxvJ28TIm132pGuPHB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712243858; c=relaxed/simple; bh=XGdU46c4ZSunIoursaUt7noQnOr0Myyw+lOAyQpQkBw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=emu+zrMWTCRxbA+WL9Pa3nMNtteQ8H4ymCSb85XjHXhqQXKGAJkSjqkR+67QKRR4ipCocyPDbVLH8j732HVCTkYEageSkzq+8/tUCY0GXKoOF42wN5NnNbk0ladzabR8pcGvEkL2Cs+hXST+/BC/4LWZei9+UPY4E6vohxY0gso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=glTE2pBD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23849C433A6; Thu, 4 Apr 2024 15:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712243857; bh=XGdU46c4ZSunIoursaUt7noQnOr0Myyw+lOAyQpQkBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glTE2pBDWJNtz53CPi1jC2NHOgh8UlSZgRMfWuGk0vRqwwkGG79q8k6iVjEyQ8dzd IJvpOZgBuLJqdJVQVW4N9AKqr1VcLum1pqUVjgTtHE3u59vRvdP0aZdKI1CHS2tFxx nmRQ7ZTPF1GqvgkdJmWINqgCB4LYKOI+3hfEtJ3fix0kQ6slqhEP3tSL0PivG6wL3T fDwc2zZF11RPwP5MpAXJ9IyQv3IrfTw6BOuVrpxQhfNry7muujtpft26SxO6QyWivT hXpY5NL8Co/mP45AOOEV4HxqVMkaNzb7OpMLF+nxgyD8VAzpxd/3bJnM1kfMs1bNUf n98N9rqGTgKtQ== From: Arnd Bergmann To: Masahiro Yamada Cc: Nathan Chancellor , Nicolas Schier , linux-kbuild@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/4] kbuild: turn on -Wextra by default Date: Thu, 4 Apr 2024 17:16:54 +0200 Message-Id: <20240404151713.3493098-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240404151713.3493098-1-arnd@kernel.org> References: <20240404151713.3493098-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