public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: John Hubbard <jhubbard@nvidia.com>
Cc: "Shuah Khan" <shuah@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Steffen Klassert" <steffen.klassert@secunet.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Andreas Färber" <afaerber@suse.de>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Matthieu Baerts" <matttbe@kernel.org>,
	"Mat Martineau" <martineau@kernel.org>,
	"Geliang Tang" <geliang@kernel.org>,
	"Pravin B Shelar" <pshelar@ovn.org>,
	"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
	"Alexander Mikhalitsyn" <alexander@mihalicyn.com>,
	zhujun2 <zhujun2@cmss.chinamobile.com>,
	"Petr Machata" <petrm@nvidia.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Hangbin Liu" <liuhangbin@gmail.com>,
	"Nikolay Aleksandrov" <razor@blackwall.org>,
	"Benjamin Poirier" <bpoirier@nvidia.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Dmitry Safonov" <0x7f454c46@gmail.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-actions@lists.infradead.org, mptcp@lists.linux.dev,
	dev@openvswitch.org, "Valentin Obst" <kernel@valentinobst.de>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH v2] selftests/net: suppress clang's "variable-sized type not at the end" warning
Date: Tue, 28 May 2024 13:39:41 -0700	[thread overview]
Message-ID: <20240528203941.GD2680415@thelio-3990X> (raw)
In-Reply-To: <20240527213641.299458-1-jhubbard@nvidia.com>

On Mon, May 27, 2024 at 02:36:41PM -0700, John Hubbard wrote:
> When building with clang, via:
> 
>     make LLVM=1 -C tools/testing/selftest
> 
> ...clang warns that "a variable sized type not at the end of a struct or
> class is a GNU extension".
> 
> These cases are not easily changed, because they involve structs that
> are part of the API. Fortunately, however, the tests seem to be doing
> just fine (specifically, neither affected test runs any differently with
> gcc vs. clang builds, on my test system) regardless of the warning. So,
> all the warning is doing is preventing a clean build of selftests/net.
> 
> Fix this by suppressing this particular clang warning for the
> selftests/net suite.
> 
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---
> 
> Changes since the first version:
> 
> 1) Rebased onto Linux 6.10-rc1
> 
> thanks,
> John Hubbard
> 
> 
>  tools/testing/selftests/net/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index bd01e4a0be2c..9a3b766c8781 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -6,6 +6,10 @@ CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES)
>  # Additional include paths needed by kselftest.h
>  CFLAGS += -I../
>  
> +ifneq ($(LLVM),)
> +    CFLAGS += -Wno-gnu-variable-sized-type-not-at-end

For what it's worth, the main kernel has -Wno-gnu because there is
little point in warning about the use of GNU extensions when building
with '-std=gnu...'. It may be worth doing this anywhere that uses a GNU
standard in the selftests but I guess it depends on how noisy things
are.

> +endif
> +
>  TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \
>  	      rtnetlink.sh xfrm_policy.sh test_blackhole_dev.sh
>  TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh ip_defrag.sh
> 
> base-commit: 2bfcfd584ff5ccc8bb7acde19b42570414bf880b
> -- 
> 2.45.1
> 
> 

  reply	other threads:[~2024-05-28 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 21:36 [PATCH v2] selftests/net: suppress clang's "variable-sized type not at the end" warning John Hubbard
2024-05-28 20:39 ` Nathan Chancellor [this message]
2024-05-28 20:56   ` John Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240528203941.GD2680415@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=afaerber@suse.de \
    --cc=alexander@mihalicyn.com \
    --cc=bigeasy@linutronix.de \
    --cc=bpoirier@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=idosch@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=kernel@valentinobst.de \
    --cc=kuba@kernel.org \
    --cc=linux-actions@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=llvm@lists.linux.dev \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=pshelar@ovn.org \
    --cc=razor@blackwall.org \
    --cc=shuah@kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=zhujun2@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox