Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp540076lqm; Wed, 1 May 2024 08:17:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7RiGGn3MkBacARkmDwVXhXfCKvXcXaKNyhoA/Xlt6nm9nbZHs8iRiY5rWfn3ZLeYVxlXq/Bk6Rt8tjFRhAJYUm4LQp9bBuOxYjT+Ziw== X-Google-Smtp-Source: AGHT+IEB+xZmrbjh/s+PojhUIPu3VqDgWHfx26r0XPL917LzA+htf1zfk4Kiqn//cYDq5KzF2H+Q X-Received: by 2002:a17:903:11c5:b0:1eb:519e:e05f with SMTP id q5-20020a17090311c500b001eb519ee05fmr3375983plh.45.1714576623085; Wed, 01 May 2024 08:17:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714576623; cv=pass; d=google.com; s=arc-20160816; b=AAcFa5ydOn+IrMQBDrdDvrQp39NVr75onvnsWyMI3icwDB+WO+KzleAOcPRg6kOAUL E6rII6pgtq8+y/SWl9FedpC5TiiDHZfO/MAnw8nStzptwqvRkR4UA+MQpmH/fkY3NbY8 bkEud6LDRkyHJAuQvsdaWYCvGnMv9ixy7cY6bCulMQ0C1zcRJBtr/fuOamz5JfrNLJui Ze2XruWzujP9f2FNWTWmYOn88Wbv7D8N7Os3esEIHuxJX4qcyIxZPptQzGIBChRfP4Gt 0FHNFmo4WXsLPw/nX6wzNgTABgCNWTchV/c9zqZ3KRqwek1XMrpVpQC/84CGyZO0joQP 2acg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KrGE25RBYLpTvzEglHAX0UWLYd57ZKQnnQ4067vf/z8=; fh=UpdNNtQCDzDb0tMQCDCoO75AIl8z/89hN9ocw24yFFQ=; b=TDXCpYARd9Goo5G9aGlGgDmd8oOEkprCXqzYKdnXMVajy1MHLfrSX2yp8c9zRCbBN1 oYoNHtbPzMsPagpeZyKV5qr2kmEq/Z/iXtX/ipQu79MJ2Oo6f8Xnave6aOEspCF0sNhX CyyolTNqicUspczMqpgKamDbmvUggHshoVGT8u+W+UAC/Q3C5MkMj+pG8r2vHsSgo/v5 EGTKuxjXlbYGxD7OiK9dIyunyNthhAAnlwwmR7VF17y6S/iwGiThF9xAljmF2xQpuvfN uqcIA/GyRssWmKvTZFJEgdiBj5+gpWte3ANXPsG6kZPUbxpSFN0dCopllDt0btmyhJ/k EcoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgn55JcK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165432-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165432-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 k18-20020a170902c41200b001e2ad8cd0d9si22260157plk.504.2024.05.01.08.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 08:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165432-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=sgn55JcK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165432-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165432-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 9AD67283978 for ; Wed, 1 May 2024 15:16:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5115132484; Wed, 1 May 2024 15:13:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sgn55JcK" 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 0575713175F; Wed, 1 May 2024 15:13:45 +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=1714576426; cv=none; b=cAmUBiy57DHdlcnkOe7ciIllkQdcT/XR4Q6HyjQNxv5oopFwU6m2Rn8mRv78DZezKb3zPk+lWgTRNWrdBn3ZYEoRNHx0aGmt7K7xIvXaw54vQrsp1UX2yauU1dJvs3ttkjcqgxE0weJwYhXe8BlBkdp2Xc/WFZh55raIwM8eD+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714576426; c=relaxed/simple; bh=YBjLSMIppWafWg7KldsTZKrs4eG5nttTEthhu+OXRyE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=boJGeukFb7N+UW2BBSGVsIxTwEitqj8GGT+ENrVjMtX+GmbGFRrWwRwfY8ykEL4txzG37bJC6lNohGpaeQKDx+PKb2WdrwiPK9fGO/uPp3B4L9E/gfjLF8pWhrRyQb/wrsLY5Wndu306inJxHpwUZPl5V/WSGkqsGC1EKqRsPDQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sgn55JcK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00153C113CC; Wed, 1 May 2024 15:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714576425; bh=YBjLSMIppWafWg7KldsTZKrs4eG5nttTEthhu+OXRyE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sgn55JcKpxb0pLy4qCshQKV2X7q87m847hTuD9aQU5FueGeUjKn1Ewd1x6Fo+tFBn 3nf/SbivuIkR97d5ZJe9t1Ux0gtgcFkXcJzYW4o3JXODsxdpWQgRDzPvRUPV9grzXp cQCzyox8PXtHPaou1zC3L7V5TYuKeuLLlPaVVI1QrVbT8dmv/feK/hBr8IdjS7I9Pg sTchsz/A3n3RoeSu6av8EHHa53C+nTj3apISSqsfkTNUgIlAgbiSyk2uGrbhNyWrkD SKWOnfmtdl+v8gfZAbF+ppCC9hJ835PC+7dw24BFM9oiZ7fVQpQjDPaXkYb7boa5Uk ocDWzBfVLm/HA== Date: Wed, 1 May 2024 08:13:43 -0700 From: Nathan Chancellor To: John Hubbard Cc: Shuah Khan , linux-kselftest@vger.kernel.org, LKML , Valentin Obst , Kees Cook , Nick Desaulniers , Justin Stitt , Bill Wendling Subject: Re: [PATCH] selftests/harness: fix many "format string is empty" warnings Message-ID: <20240501151343.GA1018661@dev-arch.thelio-3990X> References: <20240501020813.264878-1-jhubbard@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501020813.264878-1-jhubbard@nvidia.com> Hi John, On Tue, Apr 30, 2024 at 07:08:13PM -0700, John Hubbard wrote: > In order to build with clang at all, in order to see these symptoms, one > must first apply Valentin Obst's build fix for LLVM [1]. Once that is > done, then when building with clang, via: > > make LLVM=1 -C tools/testing/selftests > > ...clang emits a "format string is empty" warning. (gcc also emits a > similar warning.) The warning you are describing here sounds like the same exact one that commit caed8eba2215 ("selftests: kselftest_harness: fix Clang warning about zero-length format") should have addressed in 6.9-rc5. Is this patch actually necessary? > Fix by passing NULL, instead of "", for the msg argument to Because this text is describing what was done in caed8eba2215... > ksft_test_result_code(). This removes dozens of warnings and a few > errors (some tests have -Werror set). > > [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ > > Cc: Valentin Obst > Cc: Kees Cook > Cc: Nick Desaulniers > Cc: Nathan Chancellor > Cc: Shuah Khan > Cc: Justin Stitt > Cc: Bill Wendling > Signed-off-by: John Hubbard > --- > tools/testing/selftests/kselftest_harness.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h > index d98702b6955d..456b8694e678 100644 > --- a/tools/testing/selftests/kselftest_harness.h > +++ b/tools/testing/selftests/kselftest_harness.h > @@ -1207,8 +1207,10 @@ void __run_test(struct __fixture_metadata *f, > else > diagnostic = "unknown"; > > - ksft_test_result_code(t->exit_code, test_name, > - diagnostic ? "%s" : NULL, diagnostic); > + if (diagnostic) > + ksft_test_result_code(t->exit_code, test_name, "%s", diagnostic); > + else > + ksft_test_result_code(t->exit_code, test_name, NULL); but this diff is not doing that because it is based on a tree that has caed8eba2215; instead, it appears to be a completely identical transformation? Cheers, Nathan > free(test_name); > } > > > base-commit: 18daea77cca626f590fb140fc11e3a43c5d41354 > prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27 > -- > 2.45.0 >