Re: [arm-platforms:timers/tval-ectomy 2/17] drivers/clocksource/arm_arch_timer.c:156:3: warning: variable 'val' is used uninitialized whenever switch default is taken

From
Miguel Ojeda <hidden>
Date
2021-10-10 10:57:13
Also in
llvm, oe-kbuild-all
Reply to
Marc Zyngier, 2021-10-10
On Sun, Oct 10, 2021 at 11:37 AM Marc Zyngier [off-list ref] wrote:
I think the problem squarely lies with the compiler (or the
way it interprets the BUILD_BUG helper). If it cannot see that
BUILD_BUG() trumps the control flow analysis, then this warning
is totally useless.
The fake, generated `__compiletime_assert` should be annotated
`__noreturn`. That gives enough information to the compiler to avoid
the warning: https://godbolt.org/z/x1v69jjYY

And we should also move `__compiletime_{error,warning}` to compiler
attributes since Clang trunk has it now, so that we catch the error
earlier: https://godbolt.org/z/jd8Eb9Mf1

I will send a couple patches.

Cheers,
Miguel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (5 messages) 5 messages, 4 authors, last reply 2021-10-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help