From patchwork Fri Aug 11 14:03:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13350931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA282C41513 for ; Fri, 11 Aug 2023 14:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235802AbjHKOD7 (ORCPT ); Fri, 11 Aug 2023 10:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235788AbjHKODy (ORCPT ); Fri, 11 Aug 2023 10:03:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C66B82D78; Fri, 11 Aug 2023 07:03:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5B1E667368; Fri, 11 Aug 2023 14:03:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8848AC433C7; Fri, 11 Aug 2023 14:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691762633; bh=i4a8p6VpCCZVTYFHFo1ukva43aBF5vKJz8iLhLj/cfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQhabiPgoDUxJ1/WWsaCqFwAFlRKGjtZOKWy+Hr6jzFAaijzQsgKR1NkpBdkrWTFy UmJuel14wtHaYvv4BeorNZvGbuaD2AY4t0uZ9MyV2f7Vz34J/J6pAfqHXEe8Oj0ebv DnaHBlwRha57WdyDZFoSi9ZZBDbaxewYpFxkPatifaXKKu0WRWwL6q6mZwfUkVWj0U SLuA83rQ3AqECXGkwvJ/htSWU00oTRQT1Cnv3AD75e2mZC4sj3IL2ke3PTBXnT3sEd XALwAtFlALoGMt4H2H+CXBp4ExaDj9HSUQJm7AidPNuEAH9nYz5ccHQcanGSes8Hws 2J51cHR3rxSLg== From: Arnd Bergmann To: Masahiro Yamada Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Guenter Roeck , Lee Jones , Stephen Rothwell , linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 6/9] extrawarn: move -Wrestrict into W=1 warnings Date: Fri, 11 Aug 2023 16:03:24 +0200 Message-Id: <20230811140327.3754597-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230811140327.3754597-1-arnd@kernel.org> References: <20230811140327.3754597-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Arnd Bergmann There are few of these, so enable them whenever W=1 is enabled. Signed-off-by: Arnd Bergmann --- scripts/Makefile.extrawarn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index ec528972371fa..8abe90270b335 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -54,9 +54,6 @@ KBUILD_CFLAGS += -Wno-pointer-sign # globally built with -Wcast-function-type. KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) -# Another good warning that we'll want to enable eventually -KBUILD_CFLAGS += $(call cc-disable-warning, restrict) - # The allocators already balk at large sizes, so silence the compiler # warnings for bounds checks involving those possible values. While # -Wno-alloc-size-larger-than would normally be used here, earlier versions @@ -99,6 +96,7 @@ ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter KBUILD_CFLAGS += -Wmissing-declarations +KBUILD_CFLAGS += $(call cc-option, -Wrestrict) KBUILD_CFLAGS += -Wmissing-format-attribute KBUILD_CFLAGS += -Wmissing-prototypes KBUILD_CFLAGS += -Wold-style-definition @@ -120,6 +118,7 @@ else # Suppress them by using -Wno... except for W=1. KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) +KBUILD_CFLAGS += $(call cc-disable-warning, restrict) KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)