lkml.org 
[lkml]   [2025]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] selftests/net: initialize char variable to null
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.

\
 
 \ /
  Last update: 2025-11-24 19:16    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog