All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>
To: 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 23:29:59 +0530	[thread overview]
Message-ID: <aSSdH58ozNT-zWLM@fedora> (raw)
In-Reply-To: <willemdebruijn.kernel.6edcbeb29a45@gmail.com>

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.

Thanks,
-- Ankit

  reply	other threads:[~2025-11-24 18:00 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 [this message]
2025-11-24 18:15     ` Willem de Bruijn
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=aSSdH58ozNT-zWLM@fedora \
    --to=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 \
    --cc=willemdebruijn.kernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.