From: Joe Perches <joe@perches.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
"Moore, Robert" <robert.moore@intel.com>
Cc: "Kaneda, Erik" <erik.kaneda@intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
"clang-built-linux@googlegroups.com"
<clang-built-linux@googlegroups.com>, Len Brown <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"devel@acpica.org" <devel@acpica.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPICA: fix -Wfallthrough
Date: Thu, 12 Nov 2020 12:22:20 -0800 [thread overview]
Message-ID: <5cf1f03c2cf29ee173a7b3b81a0f2f8785b6aab8.camel@perches.com> (raw)
In-Reply-To: <CAKwvOdnu07S8ZtGVe0eVFP=6hLSRa58EtDYOJUK_zGWFaqUboA@mail.gmail.com>
On Thu, 2020-11-12 at 11:30 -0800, Nick Desaulniers wrote:
> On Thu, Nov 12, 2020 at 7:13 AM Moore, Robert <robert.moore@intel.com> wrote:
> > -----Original Message-----
> > From: Nick Desaulniers <ndesaulniers@google.com>
> > On Wed, Nov 11, 2020 at 7:15 AM Moore, Robert <robert.moore@intel.com> wrote:
> > > Yes, but: isn't the "fallthrough" keyword compiler-specific? That is the problem for us.
> > It's not a keyword.
> >
> > It's a preprocessor macro that expands to
> > __attribute__((__fallthrough__)) for compilers that support it. For compilers that do not, it expands to nothing. Both GCC 7+ and Clang support this attribute. Which other compilers that support -Wimplicit-fallthrough do you care to support?
> >
> > We need to support MSVC 2017 -- which apparently does not support this.
>
> In which case, the macro is not expanded to a compiler attribute the
> compiler doesn't support. Please see also its definition in
> include/linux/compiler_attributes.h.
>
> From what I can tell, MSVC does not warn on implicit fallthrough, so
> there's no corresponding attribute (or comment) to disable the warning
> in MSVC.
>
> That doesn't mean this code is not portable to MSVC; a macro that
> expands to nothing should not be a problem.
acpica is a special case as all the code is in a separate
repository and converted via Lindent to resemble linux
standard styles.
Perhaps it'd easier to avoid modifying acpica and add something like:
---
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index 59700433a96e..469508a8d671 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -4,6 +4,7 @@
#
ccflags-y := -Os -D_LINUX -DBUILDING_ACPICA
+ccflags-y += -Wno-implicit-fallthrough
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
# use acpi.o to put all files here into acpi.o modparam namespace
next prev parent reply other threads:[~2020-11-12 20:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 2:11 Nick Desaulniers
2020-11-11 15:15 ` Moore, Robert
2020-11-11 18:48 ` Nick Desaulniers
2020-11-12 15:13 ` Moore, Robert
2020-11-12 19:30 ` Nick Desaulniers
2020-11-12 20:22 ` Joe Perches [this message]
2020-11-12 21:47 ` Moore, Robert
2020-11-13 0:09 ` Nick Desaulniers
2020-11-13 8:14 ` Miguel Ojeda
2020-11-13 16:29 ` Joe Perches
2020-11-13 21:01 ` Moore, Robert
2020-11-13 21:04 ` Nick Desaulniers
2020-11-13 21:00 ` Nick Desaulniers
2020-11-13 8:10 ` Miguel Ojeda
2020-11-13 21:27 ` Moore, Robert
2020-11-13 21:32 ` Nick Desaulniers
2020-11-13 21:42 ` Moore, Robert
2020-11-13 21:43 ` Nick Desaulniers
2020-11-13 21:43 ` Moore, Robert
2020-11-13 21:45 ` Moore, Robert
2020-11-13 22:09 ` Nick Desaulniers
2020-11-13 22:12 ` Moore, Robert
2021-01-21 10:06 ` Jon Hunter
2021-01-21 19:03 ` Rafael J. Wysocki
2021-01-21 19:07 ` Nick Desaulniers
2021-01-21 22:05 ` Kaneda, Erik
2021-01-21 22:28 ` Kaneda, Erik
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=5cf1f03c2cf29ee173a7b3b81a0f2f8785b6aab8.camel@perches.com \
--to=joe@perches.com \
--cc=clang-built-linux@googlegroups.com \
--cc=devel@acpica.org \
--cc=erik.kaneda@intel.com \
--cc=gustavoars@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.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
all inboxes | Powered by JetHome®