[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR11MB3256ECDE31F1900EE1D9254687E60@BYAPR11MB3256.namprd11.prod.outlook.com>
Date: Fri, 13 Nov 2020 21:01:24 +0000
From: "Moore, Robert" <robert.moore@...el.com>
To: Joe Perches <joe@...ches.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>
CC: "Kaneda, Erik" <erik.kaneda@...el.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"Gustavo A . R . Silva" <gustavoars@...nel.org>,
"clang-built-linux@...glegroups.com"
<clang-built-linux@...glegroups.com>, Len Brown <lenb@...nel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"devel@...ica.org" <devel@...ica.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] ACPICA: fix -Wfallthrough
I can do it this way:
In the global header actypes.h:
#ifndef ACPI_FALLTHROUGH
#define ACPI_FALLTHROUGH
#endif
In the gcc-specific header (acgcc.h):
#define ACPI_FALLTHROUGH __attribute__((__fallthrough__))
This would not be #defined in the MSVC-specific header (acmsvc.h) -- thus using the default (null) in actypes.h (The per-environment headers are always included first).
(We do all macros in upper case, prefixed with "ACPI_")
If you can update your patch to use ACPI_FALLTHROUGH, I can do the rest (above).
Thanks,
Bob
-----Original Message-----
From: Joe Perches <joe@...ches.com>
Sent: Friday, November 13, 2020 8:30 AM
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>; Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Moore, Robert <robert.moore@...el.com>; Kaneda, Erik <erik.kaneda@...el.com>; Wysocki, Rafael J <rafael.j.wysocki@...el.com>; Gustavo A . R . Silva <gustavoars@...nel.org>; clang-built-linux@...glegroups.com; Len Brown <lenb@...nel.org>; linux-acpi@...r.kernel.org; devel@...ica.org; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ACPICA: fix -Wfallthrough
On Fri, 2020-11-13 at 09:14 +0100, Miguel Ojeda wrote:
> On Fri, Nov 13, 2020 at 1:09 AM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > Thank you for the explicit diagnostics observed. Something fishy is
> > going on though, https://godbolt.org/z/Gbxbxa is how I expect MSVC
> > to handle include/linux/compiler_attributes.h.
> >
> > The C preprocessor should make it such that MSVC never sees
> > `__attribute__` or `__fallthrough__`; that it does begs the question.
> > That would seem to imply that `#if __has_attribute(__fallthrough__)`
> > somehow evaluates to true on MSVC, but my godbolt link shows it does
> > not.
> >
> > Could the upstream ACPICA project be #define'ing something that
> > could be altering this? (Or not #define'ing something?)
> >
> > Worst case, we could do as Joe Perches suggested and disable
> > -Wfallthrough for drivers/acpi/acpica/.
>
> I agree, something is fishy. MSVC has several flags for conformance
> and extensions support, including two full C preprocessors in newer
> versions; which means we might be missing something, but I don't see
> how the code in compiler_attributes.h could be confusing MSVC even in
> older non-conforming versions.
I believe this has nothing to do with linux and only to do with compiling acpica for other environments like Windows.
From: https://acpica.org/
The ACPI Component Architecture (ACPICA) project provides an operating system (OS)-independent reference implementation of the Advanced Configuration and Power Interface Specification (ACPI).
It can be easily adapted to execute under any host OS.
Powered by blists - more mailing lists