Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
From: "Moore, Robert" <robert.moore@intel.com>
To: Joe Perches <joe@perches.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: "Kaneda, Erik" <erik.kaneda@intel.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	Len Brown <lenb@kernel.org>,
	"ACPI Devel Maling List" <linux-acpi@vger.kernel.org>,
	"open list:ACPI COMPONENT ARCHITECTURE (ACPICA)"
	<devel@acpica.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH][next] ACPICA: Use fallthrough pseudo-keyword
Date: Tue, 28 Jul 2020 15:09:09 +0000
Message-ID: <BYAPR11MB3256C443C13A51B8B82C6D5E87730@BYAPR11MB3256.namprd11.prod.outlook.com> (raw)
In-Reply-To: <ae54364041b99b89f818812d957d4a4bb4efdc25.camel@perches.com>

Yes, but:

include/linux/compiler_attributes.h

This file is linux-specific and cannot be used with ACPICA.
Bob


-----Original Message-----
From: Joe Perches <joe@perches.com> 
Sent: Monday, July 27, 2020 7:22 PM
To: Gustavo A. R. Silva <gustavo@embeddedor.com>; Moore, Robert <robert.moore@intel.com>; Rafael J. Wysocki <rafael@kernel.org>; Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>; ACPI Devel Maling List <linux-acpi@vger.kernel.org>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA) <devel@acpica.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] ACPICA: Use fallthrough pseudo-keyword

On Mon, 2020-07-27 at 17:23 -0500, Gustavo A. R. Silva wrote:
> Hi,
> 
> 
> This is a macro pseudo-keyword, which expands to /* fallthrough */ for 
> compilers that don't support the attribute __fallthrough__. See:

Not really.

It expands to
	do {} while (0)
for compilers that do not support the __fallthrough__ attribute.

The /* fallthrough */ after that is for the human reader and is stripped before compilation.

> include/linux/compiler_attributes.h:213:
> 213 #if __has_attribute(__fallthrough__)
> 214 # define fallthrough                    __attribute__((__fallthrough__))
> 215 #else
> 216 # define fallthrough                    do {} while (0)  /* fallthrough */
> 217 #endif
> 
> So, any compiler (older or new) will be fine with it.

But old compilers should not emit warnings for these uses.



      reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 20:07 Gustavo A. R. Silva
2020-07-08 10:58 ` Rafael J. Wysocki
2020-07-08 14:17   ` Moore, Robert
2020-07-27 22:23     ` Gustavo A. R. Silva
2020-07-28  2:22       ` Joe Perches
2020-07-28 15:09         ` Moore, Robert [this message]

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=BYAPR11MB3256C443C13A51B8B82C6D5E87730@BYAPR11MB3256.namprd11.prod.outlook.com \
    --to=robert.moore@intel.com \
    --cc=devel@acpica.org \
    --cc=erik.kaneda@intel.com \
    --cc=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=joe@perches.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.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

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org
	public-inbox-index linux-acpi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git