[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250430233214.GC3715926@ax162>
Date: Wed, 30 Apr 2025 16:32:14 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>, stable@...r.kernel.org,
patches@...ts.linux.dev, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
linux@...ck-us.net, shuah@...nel.org, patches@...nelci.org,
lkft-triage@...ts.linaro.org, pavel@...x.de, jonathanh@...dia.com,
f.fainelli@...il.com, sudipm.mukherjee@...il.com,
srw@...dewatkins.net, rwarsow@....de, conor@...nel.org,
hargar@...rosoft.com, broonie@...nel.org,
clang-built-linux <llvm@...ts.linux.dev>,
Anders Roxell <anders.roxell@...aro.org>,
Arnd Bergmann <arnd@...db.de>,
Dan Carpenter <dan.carpenter@...aro.org>,
linux-s390@...r.kernel.org, linux-mips@...r.kernel.org,
io-uring@...r.kernel.org, virtualization@...ts.linux.dev
Subject: Re: [PATCH 6.1 000/167] 6.1.136-rc1 review
On Wed, Apr 30, 2025 at 12:58:13PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 30, 2025 at 04:09:18PM +0530, Naresh Kamboju wrote:
> > Regressions on x86_64 with defconfig builds with clang-nightly toolchain
> > on the stable-rc 6.1.136-rc1.
clang-nightly is always a moving target so for the sake of the stable
-rc reports, I would only focus on issues that appear with just those
patches, as you should see this issue on 6.1.136.
> > * x86_64, build
> > - clang-nightly-lkftconfig
> > - clang-nightly-x86_64_defconfig
> >
> > Regression Analysis:
> > - New regression? Yes
> > - Reproducibility? Yes
> >
> > Build regression: x86_64 clang-nightly net ip.h error default
> > initialization of an object of type 'typeof (rt->dst.expires)'
> >
> > Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> >
> > ## Build error x86_64
> > include/net/ip.h:462:14: error: default initialization of an object of
> > type 'typeof (rt->dst.expires)' (aka 'const unsigned long') leaves the
> > object uninitialized and is incompatible with C++
> > [-Werror,-Wdefault-const-init-unsafe]
> > 462 | if (mtu && time_before(jiffies, rt->dst.expires))
> > | ^
>
> This isn't c++, so are you sure this isn't just a clang bug?
Yes, it is intentional that this warns for C code, the clang maintainer
felt that the default initialization behavior of const variables not
marked as static or thread local was worth warning about by default.
https://github.com/llvm/llvm-project/pull/137166
But it is going to be adjusted to allow the kernel to opt-out of the
warning for aggregate members, as that triggers often in the kernel:
https://github.com/llvm/llvm-project/pull/137961
The only instance of -Wdefault-const-init-var-unsafe that I have found
so far is in typecheck(), which should be easy enough to clean up.
Cheers,
Nathan
diff --git a/include/linux/typecheck.h b/include/linux/typecheck.h
index 46b15e2aaefb..5b473c9905ae 100644
--- a/include/linux/typecheck.h
+++ b/include/linux/typecheck.h
@@ -7,8 +7,8 @@
* Always evaluates to 1 so you may use it easily in comparisons.
*/
#define typecheck(type,x) \
-({ type __dummy; \
- typeof(x) __dummy2; \
+({ type __dummy = {}; \
+ typeof(x) __dummy2 = {}; \
(void)(&__dummy == &__dummy2); \
1; \
})
Powered by blists - more mailing lists