From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Kees Cook <keescook@chromium.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [GIT PULL] fallthrough fixes for Clang for 5.14-rc2
Date: Thu, 15 Jul 2021 20:29:07 -0500 [thread overview]
Message-ID: <31b951ff-9c65-b774-87a9-35c28e54636a@embeddedor.com> (raw)
In-Reply-To: <CAHk-=wj8GqP8ughGBbwcyrBNNdtcXVo_G=XjQ1MAUVUuJfUtGg@mail.gmail.com>
On 7/15/21 20:22, Linus Torvalds wrote:
> On Thu, Jul 15, 2021 at 6:14 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> Kees just opened a bug report for this:
>>
>> https://bugs.llvm.org/show_bug.cgi?id=51094
>
> I don't have an account on that bugzilla, but it might be worth adding
> the note that no warning or error should EVER not say where it
> happens.
Yeah; I'll add that to the report.
Here is the current description of the bug:
"There are some places in the kernel where the "fallthrough;" annotation is used after a portion of code that may get elided at build time:
case 1:
if (something || !IS_ENALBED(CONFIG_SOMETHING))
return blah;
fallthrough;
case 2:
This looks like:
case 1:
fallthrough;
case 2:
And a warning is generated:
warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
But isn't a useful warning in this case, and should likely be silenced or adjust to not warn where there was actually code there before getting elided. At the
least, this warning would be best moved to a separate flag so it can be disabled on kernel builds (i.e. GCC does not warn about these cases).
Some specific examples:
https://github.com/ClangBuiltLinux/continuous-integration2/runs/3058126539?check_suite_focus=true#step:5:120
https://github.com/ClangBuiltLinux/continuous-integration2/runs/3058126329?check_suite_focus=true#step:5:92
"
> That's the thing that made me pissed off in the first place. I build
> my kernels with "make -j128", and if the warning doesn't specify the
> filename and the line number, the warning is just unacceptably bad.
>
> How can a compiler _ever_ give a warning without specifying where it is?
>
> The fact that the warning is also entirely wrong-headed in the first
> place is just the extra cherry on top.
>
> But at least it should hopefully make it easy to fix in clang - just
> remove the incredibly broken thing entirely.
>
> Linus
>
--
Gustavo
next prev parent reply other threads:[~2021-07-16 1:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 20:05 Gustavo A. R. Silva
2021-07-15 21:15 ` pr-tracker-bot
2021-07-16 1:04 ` Linus Torvalds
2021-07-16 1:16 ` Gustavo A. R. Silva
2021-07-16 1:22 ` Linus Torvalds
2021-07-16 1:29 ` Gustavo A. R. Silva [this message]
2021-07-16 18:47 ` Nathan Chancellor
2021-07-16 18:57 ` Gustavo A. R. Silva
2021-07-16 19:18 ` Nathan Chancellor
2021-07-16 19:26 ` Linus Torvalds
2021-07-16 19:22 ` Linus Torvalds
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=31b951ff-9c65-b774-87a9-35c28e54636a@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=clang-built-linux@googlegroups.com \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®