Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp92203lqf; Tue, 26 Mar 2024 15:43:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjGTWlNWikEHMdk/R0ZZ+2A9bre04be6xYz7YQe4/Wk6xgoC/COK/aWtlKoR/et8iGF20C/oJgxFLsg/RDy4obuXynxjfBYdYeb+65QA== X-Google-Smtp-Source: AGHT+IEtk9zBlzjobG+A2inyZH9uenwqWw9FQUeBdMBqPARGXLo0hfd9jor711UKdQRJA8vJwP50 X-Received: by 2002:a17:903:2b0f:b0:1dd:c953:cfa0 with SMTP id mc15-20020a1709032b0f00b001ddc953cfa0mr5388539plb.48.1711493036936; Tue, 26 Mar 2024 15:43:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711493036; cv=pass; d=google.com; s=arc-20160816; b=oGJdURcQZlmKf2jcV6acL1bYNHgz/3JvuV0ZhD8Cacw2bCaBS18Z0hQ4gYVbBye9JX Co2s0PoyRBlqKvuwp6yOOoealo+vRB+kUpNXKtYafkxgxXkgAlztNlN3WWCkajfFOy6E 8yFA4NkDYyPQYVd0B8NfV0Wjh3vu3MPQ0ympP/R6Mgj7ME0pZt8g/gYCzjJy9ADCWxxI paTyULVuhJ9BGVVcCHaOnL3h7sSAmGuzrDktwy0z5qC9Z1jYDhBcev9BtWMvBSxGmP00 ShYon0IKkJ0tMDi1e1L/I6xuKcWMdMWZVqyNVfgKB37fOJhns9rMlmEHe17ldnn6BdHS XHdA== 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=sY8AkgUTItUslk+dBx6TNuLIRgtFHGxzXPmOTXTI7p0=; fh=R9azPKfhzmn+3++T3q33mm1x9GrgSCEQYhOyZdwqe0g=; b=VHRO9Nr4VisUiNGcV/l33QpmtFaSys/m5Vq/1p/TxIB+bGgjfxNb00yJOyEKTC77p2 TxLJrwzU6HfDaIp1ZzMxOKVVJFzsm4X27i33j3aaC6iHctw0Y2HEWUfEamfWalJvcJuH evw1vGCOgr8FtS/CwXdtln894xo/IL6sxoxrUQiPr12jhrq8wxTOHZHsmZXO91eeSM+6 SsmkXzB1jVB366YLEYVDhCVTnRyZN1Mq+bjMIljzPCX+rc7s6pdVG5f/dc8DFNACVZym Cc881GQpC54DGKoNHV18xv0UGQq+j5awfDHiNGM7hmmCsqg8ASysRHZaCgZDvfkI+AsE tYaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9fQ35pf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ja1-20020a170902efc100b001e04cf1bda6si7910066plb.615.2024.03.26.15.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:43:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9fQ35pf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120087-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 436BD322F8D for ; Tue, 26 Mar 2024 22:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E44D140380; Tue, 26 Mar 2024 22:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I9fQ35pf" 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 2B3B713E3E0; Tue, 26 Mar 2024 22:41:22 +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=1711492882; cv=none; b=DFiahEEvWs3ILjgq0IwFsCc6y7Vm4pZpEnBe5hW8SoMThkSDUrDJm+Y1NDH8VbGQ5TQe7+TgO1Sz2h8KhrxeYRm3LHukQ4GEQt2JC1/kXSUyFDRgWCsEQ3cW4HGTRs3NdmFP8CjBAcEh5w5INQdsNHW+FNaHmQRkCrfr8Zs/aZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492882; c=relaxed/simple; bh=BHHE3ORH5YV5tg3gu2Rwntqjj9sCTM2b4pqOaKJSHJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J9OjHCNf1BghRpiixFHXrhf+KwfYSUOEXUXPrr8QxMI14mgKjOFnTTX2lIef+X+ZjTCHyROitPZldZXDzgzMY8qPRwWCHGHS7v5vBzVh4rAALuWLNZyfVNBl4eAH1HZnhf0dY70ewZHleCEYwQUgY/3orWaUEFYFmXM/rLXav0o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I9fQ35pf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC3ACC433F1; Tue, 26 Mar 2024 22:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711492882; bh=BHHE3ORH5YV5tg3gu2Rwntqjj9sCTM2b4pqOaKJSHJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9fQ35pfMxFLBIfKGlKWnIJLrE+vSgKdW74QfNRyDBLX6zoZHWGKVsZ8zj1v+qzZK rsLWOzLlnUi5DaQklbuXHCpM5y0uJjQxvHn5/T/6VJ6J8xgK1/RrRIrgnrWN+lOu0q N8zMbU0hFv6oUX9Cfk88+RKSpzoAiOghhFlD7FKuSLToHcxMhj9KWhU0svyn+aelMZ 0bWpVVcfJiB3uN8W9awWRVLdx5Miroq5QcVs5em8UwxVAsGc0OKvjz2z5J0NuWXcNg eNF89gZ0xcrrQxrUJN6mjmZQXscXYbiYmna7+oI9bWmsqzerPv16CzS6AA0aG3qobf ek85NmEPOEF+Q== From: Arnd Bergmann To: llvm@lists.linux.dev, Masahiro Yamada , Nathan Chancellor Cc: Arnd Bergmann , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] kbuild: enable -Wformat-truncation on clang Date: Tue, 26 Mar 2024 23:38:08 +0100 Message-Id: <20240326223825.4084412-10-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326223825.4084412-1-arnd@kernel.org> References: <20240326223825.4084412-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 This warning option still produces output on gcc but is now clean when building with clang, so enable it conditionally on the compiler for now. As far as I can tell, the remaining warnings with gcc are the result of analysing the code more deeply across inlining, while clang only does this within a function. Signed-off-by: Arnd Bergmann --- scripts/Makefile.extrawarn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index bff6c686df7c..aa1c716c4812 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -99,7 +99,9 @@ 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, packed-not-aligned) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) +ifdef CONFIG_CC_IS_GCC KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) +endif KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) KBUILD_CFLAGS += -Wno-override-init # alias for -Wno-initializer-overrides in clang -- 2.39.2