Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp14307ybl; Mon, 12 Aug 2019 10:54:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyda+CPc+afpFNmfOnwBiImnevejEbcp89orDwJDzA8eS8fdrmQPod1Vxkfcrr1J6aEfqZ X-Received: by 2002:a62:3543:: with SMTP id c64mr35977594pfa.242.1565632458748; Mon, 12 Aug 2019 10:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565632458; cv=none; d=google.com; s=arc-20160816; b=ta91H+x2CYQWcqjy0zPaBFt9NENs3CKmE4PFb/7405ZeK8m61Sy32WiNIrPydnzybS ArN0bcPWN9iMB48Qc1w0/kps4j8UDHyy6PA65m6WZgzgnKeDHoM3X+84qs7UonP/LJfK Xp+B1Bk4EkTxWOieVxDyZKLQ18yvtPD2UNe8kj4FuG/422AqPP28hSw9acaPCcCTz5NQ nSqHqjpPsjrhR+ilbD7qUtYK69WrltZyRlVdqOXSegAvb3KULWe4zSx2RFLgCNqrXCIz kUGN8sELnuLAIYrxpVrEVnFkfIla3wzSnAha0PNIXgaK8hZUkBP3s95W3zy13H52CU3I oNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=9n3rD3aC8e+Tu9JHIraTpdDNaNf7InJBqszmdj/65Oo=; b=rNalThE2okrx94IopRzgJH/vbTIrWe4w+RYtXb6A0ATwa1/2GSSWkkcN1TJ2cM+/vn u/tSv7kTpbFoHppwlXnhA6LYDI9gVPHNrwKBjErXXHRgaL4/zdOj+yTT1m9TIHvq/h0k fnbL+1G/YATb+LcgL3UAQ3EngfnbxVwbhuTYSkepD7icHuxLynZRfg9tdlMXP9ZYs9i6 JP2hRqr8BFbjj1Ecu8/aHqmIQx+4tff0KAhM5OHU6gUIq1NvIWeT1stUS2+bdwSlUhpg IV1AUEJGWeVUKafOkQgISIkJbshezn4CF0TnEErIud7I3y9qGhrcFII+XF42U0Xq4pun f/MA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si62430882pfi.183.2019.08.12.10.54.02; Mon, 12 Aug 2019 10:54:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbfHLRwH (ORCPT + 99 others); Mon, 12 Aug 2019 13:52:07 -0400 Received: from smtprelay0037.hostedemail.com ([216.40.44.37]:51767 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726263AbfHLRwG (ORCPT ); Mon, 12 Aug 2019 13:52:06 -0400 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave08.hostedemail.com (Postfix) with ESMTP id B1683182D3681 for ; Mon, 12 Aug 2019 17:42:31 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 83FA9182CF666; Mon, 12 Aug 2019 17:42:31 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:69:355:379:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:2693:2828:2898:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:7264:7903:7904:9108:10004:10400:10450:10455:10848:11232:11658:11914:12043:12114:12297:12683:12740:12760:12895:13141:13161:13211:13229:13230:13255:13439:14095:14096:14659:14877:19904:19999:21080:21324:21627:30012:30054:30062:30070:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:37,LUA_SUMMARY:none X-HE-Tag: truck80_6d27145108e3b X-Filterd-Recvd-Size: 3646 Received: from XPS-9350 (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Mon, 12 Aug 2019 17:42:29 +0000 (UTC) Message-ID: Subject: Re: [PATCH] Makefile: Convert -Wimplicit-fallthrough=3 to just -Wimplicit-fallthrough for clang From: Joe Perches To: Nick Desaulniers Cc: Nathan Chancellor , Linus Torvalds , "Gustavo A. R. Silva" , LKML , clang-built-linux Date: Mon, 12 Aug 2019 10:42:28 -0700 In-Reply-To: References: <9c7a79b4d21aea52464d00c8fa4e4b92638560b6.camel@perches.com> <6a5f470c1375289908c37632572c4aa60d6486fa.camel@perches.com> <20190811020442.GA22736@archlinux-threadripper> <871efd6113ee2f6491410409511b871b7637f9e3.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-08-12 at 09:28 -0700, Nick Desaulniers wrote: > Isn't [[fallthrough]] the C++ style attribute? double brackets will likely at some point become the default attribute style for c as well. It is not now though and linux will continue to support gcc 7+ and the __attribute__ style for quite a while. The minimum gcc version just moved to 4.6 which was released in 2013 so likely linux won't move to something that requires [[]] for a decade or more. > **eek** Seems to be a > waste for Clang to implement __attribute__((fallthrough)) just as we > switch the kernel to not use it. clang already supports the __attribute__(()) style for gcc compatibility. This is just clang supporting a new type which would nominally be required for gcc compatibility anyway. > Also, I'd recommend making the > preprocessor define all caps to help folks recognize it's a > preprocessor define. It's more a matching styles thing. I rather suspect that the c committees would choose to add fallthrough as a keyword if it was possible, but it is not possible without risking breaking existing code. linux source code is not constrained by this requirement. In my opinion, case statement blocks should always use a terminating keyword. I think the best option is to add fallthrough as a keyword, but there are other options: IMO the best option is: break;; goto; return; fallthrough; or (slightly worse) break; goto; return; __fallthrough; or (even worse) break; goto; return; FALLTHROUGH; Generic arguments pro/con for each style: ---------------------------------------- fallthrough looks like normal code but could not be used in uapi headers. __fallthrough is underscore prefixed, so reserved and generic, and could be used in uapi headers. __fallthrough is rather unnatural looking when used to terminate a case statement block. FALLTHROUGH looks like a macro, but could not be used in uapi headers. It is also rather unnatural looking when used to terminate a case statement block. ---------------------------------------- There are no existing uses of fallthrough in uapi headers.