netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Jason Xing <kernelxing@tencent.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Simon Horman <horms@kernel.org>,  Shuah Khan <shuah@kernel.org>,
	 netdev@vger.kernel.org,  linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/net: initialize char variable to null
Date: Mon, 24 Nov 2025 13:15:33 -0500	[thread overview]
Message-ID: <willemdebruijn.kernel.1e69bae6de428@gmail.com> (raw)
In-Reply-To: <aSSdH58ozNT-zWLM@fedora>

Ankit Khushwaha wrote:
> On Mon, Nov 24, 2025 at 12:46:52PM -0500, Willem de Bruijn wrote:
> > Ankit Khushwaha wrote:
> > > char variable in 'so_txtime.c' & 'txtimestamp.c' left uninitilized
> > > by when switch default case taken. raises following warning.
> > > 
> > > 	txtimestamp.c:240:2: warning: variable 'tsname' is used uninitialized
> > > 	whenever switch default is taken [-Wsometimes-uninitialized]
> > > 
> > > 	so_txtime.c:210:3: warning: variable 'reason' is used uninitialized
> > > 	whenever switch default is taken [-Wsometimes-uninitialized]
> > > 
> > > initialize these variables to NULL to fix this.
> > > 
> > > Signed-off-by: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>
> > 
> > These are false positives as the default branches in both cases exit
> > the program with error(..).
> > 
> > Since we do not observe these in normal kernel compilations: are you
> > enabling non-standard warnings?
> 
> Hi Willem,
> 
> this warning appeared while building the 'tools/testing/selftests/net'
> multiple times. 
> Cmd used to build
> 	make -C tools/testing/selftests/net  CC=clang V=1 -j8
> 
> while test building by "make -C tools/testing/selftests/ CC=clang V=1
> -j8" doesn't raises these warning.

This does not reproduce for me.

Can you share the full clang command that V=1 outputs, as well as the
output oof clang --version.

  reply	other threads:[~2025-11-24 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 16:13 [PATCH] selftests/net: initialize char variable to null Ankit Khushwaha
2025-11-24 17:46 ` Willem de Bruijn
2025-11-24 17:59   ` Ankit Khushwaha
2025-11-24 18:15     ` Willem de Bruijn [this message]
2025-11-25  4:33       ` Ankit Khushwaha
2025-11-25 16:04         ` Willem de Bruijn
2025-11-25 16:14           ` Willem de Bruijn

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=willemdebruijn.kernel.1e69bae6de428@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=ankitkhushwaha.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernelxing@tencent.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).