From: Nick Desaulniers <ndesaulniers@google.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Marc Zyngier <maz@kernel.org>, kernel test robot <lkp@intel.com>,
llvm@lists.linux.dev, kbuild-all@lists.01.org,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Oliver Upton <oupton@google.com>,
Mark Rutland <mark.rutland@arm.com>
Subject: 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
Date: Mon, 11 Oct 2021 13:18:34 -0700 [thread overview]
Message-ID: <CAKwvOd=-VQHxp+Ar27LyqPMmMMt-mRu+32uD50dk6eWMfAj1VQ@mail.gmail.com> (raw)
In-Reply-To: <CANiq72=-2t=ty2SFX=ZTNvcWC05-0AiaVBdy9s-rENEb53EFUw@mail.gmail.com>
On Sun, Oct 10, 2021 at 3:55 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Sun, Oct 10, 2021 at 11:37 AM Marc Zyngier <maz@kernel.org> 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
next prev parent reply other threads:[~2021-10-11 20:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-09 21:12 [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 kernel test robot
2021-10-10 9:37 ` Marc Zyngier
2021-10-10 10:54 ` Miguel Ojeda
2021-10-11 20:18 ` Nick Desaulniers [this message]
2021-10-14 13:27 ` Miguel Ojeda
2021-11-07 2:10 kernel test robot
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='CAKwvOd=-VQHxp+Ar27LyqPMmMMt-mRu+32uD50dk6eWMfAj1VQ@mail.gmail.com' \
--to=ndesaulniers@google.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=oupton@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).