Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp639236pxb; Thu, 12 Nov 2020 12:25:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKyPjd/Djq6esVBqn6fC68XMrHKSlg6oGKNj+RTg2d05DgQn/YP80xCRkRFJD+9APfqevS X-Received: by 2002:a05:6402:22ab:: with SMTP id cx11mr1723995edb.98.1605212732086; Thu, 12 Nov 2020 12:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605212732; cv=none; d=google.com; s=arc-20160816; b=xS5zAkjZoOtoeFRK5foQ1/CGtD61DnXFt6OO8Jztd8wwk2oq8bF0eVVz6OkWwPV8YB i4KL/8uXkDjBnRSnXDGfu8n7pkW5u55KZSIhvdEdP1fSmG/sEv/PC4IjUgEblvUdjtEF C2KR1lb+hULmDOBKzJQ+0YfbFUNgfUBfGcyGQ/s+Llbb0mRlYewi+mQp+VSEa93yTrLe rRBns+oPmVOV2dD0GmZV9AdqhVNE5GjVUSRv218uR2G4fw8Dz4brH1r6GXyhpa7uSPNs DXoRQXiFjVBu/H434lmPN599RGeLVzQ1EXsFN2zMrYpTU2ybyrAc+0vcS2o2YM6do4K1 8NCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=4wAZ4Hir6hRgzUg5YR+6Gu5DbtyihpF7uLEIGjYKZSk=; b=ySfI+D0jDfbKqrsY6MozHxvoRW+a924XfXDnNh0lpKQQ9+IQX4/gXtTA4QDDro8PEp ZYbjafCm4Zt/Dy+PSYnJ8NAH3pF0gw10iCbZENHTatqJR+k/e+wsd4vNAJBXRn9zuFtB muP+ZBhFTUWKj53K5gYapJKNcXIB3cHOE8TK1f7dwaC8fMH3dnPTyL1aNOLSmWXMh8iS TAkpRoH3bJK0jwBkdzKw/AKqZSUA1nOXUw9W2LBD9icUg3lkKWMa8pi0RWBo16iOQ42m HoTDYyjwciGo7k7/+HNIfIunjepMTPSIZTYdxPNGhhvLvjzv3iS46WlHl4+JAIQT1fHg amCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si4288496ejc.60.2020.11.12.12.25.05; Thu, 12 Nov 2020 12:25:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727022AbgKLUW0 (ORCPT + 99 others); Thu, 12 Nov 2020 15:22:26 -0500 Received: from smtprelay0218.hostedemail.com ([216.40.44.218]:50020 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727000AbgKLUWZ (ORCPT ); Thu, 12 Nov 2020 15:22:25 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 7DB5E181D3025; Thu, 12 Nov 2020 20:22:23 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3873:3874:4321:5007:6117:6119:7576:7875:7974:10004:10400:10848:11026:11232:11473:11658:11914:12043:12297:12555:12740:12760:12895:12986:13069:13095:13311:13357:13439:14096:14097:14181:14659:14721:21080:21433:21627:30012:30054:30063:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: yard96_2014c8327309 X-Filterd-Recvd-Size: 3419 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Thu, 12 Nov 2020 20:22:21 +0000 (UTC) Message-ID: <5cf1f03c2cf29ee173a7b3b81a0f2f8785b6aab8.camel@perches.com> Subject: Re: [PATCH] ACPICA: fix -Wfallthrough From: Joe Perches To: Nick Desaulniers , "Moore, Robert" Cc: "Kaneda, Erik" , "Wysocki, Rafael J" , "Gustavo A . R . Silva" , "clang-built-linux@googlegroups.com" , Len Brown , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , "linux-kernel@vger.kernel.org" Date: Thu, 12 Nov 2020 12:22:20 -0800 In-Reply-To: References: <20201111021131.822867-1-ndesaulniers@google.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-11-12 at 11:30 -0800, Nick Desaulniers wrote: > On Thu, Nov 12, 2020 at 7:13 AM Moore, Robert wrote: > > -----Original Message----- > > From: Nick Desaulniers > > On Wed, Nov 11, 2020 at 7:15 AM Moore, Robert 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