From nobody Sat Nov 30 10:44:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1611154692; cv=none; d=zohomail.com; s=zohoarc; b=dgsXuRwaL9lBwOobDYM6x5Sx/d3JS4XHertZGnUXrbccT8Kiff9CZYDL8/HcyUxe6x5Z3Sje8mI+PflWyO3czb68qS8aV6imWZVRV6AlreQ2n6ka56Vb3OxO0SzmTIeHcOPM+xzuJeaX5kdz78e3zmzIM4f1JL/Ic0mOebET4NM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611154692; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=EksJ95Q8vqR4NDS8nwrM63FOXDJBcR8fW/VlOUZfudg=; b=aJXPh3jROkbKa5jHgeyh8IYuTn8KoQ7+n6yCaRRo7arWD7TS9RpPWDoi1rTxq+3h9A4MXTsoQXYb3LApBBT0FuBXSWHfidCVOz+LmHYVqOX1hB4RRp1NBXpj4X5CIJ59kGWuWJ6z37d794M4xDJtq41MnAM3CDpqlTpyRPz2+PU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611154692292238.7514512280245; Wed, 20 Jan 2021 06:58:12 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.71509.128122 (Exim 4.92) (envelope-from ) id 1l2Evl-0001fD-TI; Wed, 20 Jan 2021 14:57:57 +0000 Received: by outflank-mailman (output) from mailman id 71509.128122; Wed, 20 Jan 2021 14:57:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2Evl-0001f5-Q2; Wed, 20 Jan 2021 14:57:57 +0000 Received: by outflank-mailman (input) for mailman id 71509; Wed, 20 Jan 2021 14:57:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2Evk-0001et-RX for xen-devel@lists.xenproject.org; Wed, 20 Jan 2021 14:57:56 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id c1e473da-0c96-4920-8a37-7c668fedafda; Wed, 20 Jan 2021 14:57:55 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB71331B; Wed, 20 Jan 2021 06:57:55 -0800 (PST) Received: from scm-wfh-server-rahsin01.stack04.eu02.mi.arm.com (unknown [10.58.246.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D41C3F68F; Wed, 20 Jan 2021 06:57:54 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c1e473da-0c96-4920-8a37-7c668fedafda From: Rahul Singh To: xen-devel@lists.xenproject.org Cc: bertrand.marquis@arm.com, rahul.singh@arm.com, Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v5 07/10] xen/compiler: import 'fallthrough' keyword from linux Date: Wed, 20 Jan 2021 14:52:41 +0000 Message-Id: <451cc96ebe70bd7c7ffe34862412adc2f86caaca.1611153615.git.rahul.singh@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" -Wimplicit-fallthrough warns when a switch case falls through. Warning can be suppress by either adding a /* fallthrough */ comment, or by using a null statement: __attribute__ ((fallthrough)) Define the pseudo keyword 'fallthrough' for the ability to convert the various case block /* fallthrough */ style comments to null statement "__attribute__((__fallthrough__))" In C mode, GCC supports the __fallthrough__ attribute since 7.1, the same time the warning and the comment parsing were introduced. fallthrough devolves to an empty "do {} while (0)" if the compiler version (any version less than gcc 7) does not support the attribute. Signed-off-by: Rahul Singh Reviewed-by: Stefano Stabellini Reviewed-by: Bertrand Marquis --- Changes since v3: - This patch is introduce in this version. Changes since v4: No changes --- --- xen/include/xen/compiler.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index e643e69128..0ec0b4698e 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -33,6 +33,22 @@ #define unreachable() __builtin_unreachable() #endif =20 +/* + * Add the pseudo keyword 'fallthrough' so case statement blocks + * must end with any of these keywords: + * break; + * fallthrough; + * goto