# 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: Nick Desaulniers \<ndesaulniers@google.com\>
- Date: 2021-10-11 20:21:57 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/10/8812668
- Thread: https://ratatoskr.run/llvm/2021/10/8812583/t.md

```text
On Sun, Oct 10, 2021 at 3:55 AM Miguel Ojeda
[ref] wrote:
>
> On Sun, Oct 10, 2021 at 11:37 AM Marc Zyngier [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

SGTM, please do.

>
> 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

Didn't I send a patch for that?
b83a908498d68fafca931e1276e145b339cac5fb
is in mainline.
-- 
Thanks,
~Nick Desaulniers

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
