From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92A2C31E5B for ; Mon, 17 Jun 2019 16:26:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B62482084A for ; Mon, 17 Jun 2019 16:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbfFQQ0B (ORCPT ); Mon, 17 Jun 2019 12:26:01 -0400 Received: from smtprelay0173.hostedemail.com ([216.40.44.173]:37422 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbfFQQ0B (ORCPT ); Mon, 17 Jun 2019 12:26:01 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 8EF30180A8120; Mon, 17 Jun 2019 16:25:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: sugar91_6e38cc9854f4f X-Filterd-Recvd-Size: 1749 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Mon, 17 Jun 2019 16:25:57 +0000 (UTC) Message-ID: <45e070039e66b1cb1490a78d4805bc73cc09f571.camel@perches.com> Subject: Re: [PATCH] Use fall-through attribute rather than magic comments From: Joe Perches To: Pavel Machek , Shawn Landden Cc: linux-kernel@vger.kernel.org, "Gustavo A . R . Silva" , Andy Whitcroft Date: Mon, 17 Jun 2019 09:25:56 -0700 In-Reply-To: <20190617155643.GA32544@amd> References: <20190316033841.7659-1-shawn@git.icu> <20190617155643.GA32544@amd> 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-06-17 at 17:56 +0200, Pavel Machek wrote: > Hi! > > > +/* > > + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough > > + * gcc: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ > > + */ > > +#if __has_attribute(__fallthrough__) > > +# define __fallthrough __attribute__((__fallthrough__)) > > +#else > > +# define __fallthrough > > +#endif > > Is it good idea to add the __'s ? They look kind of ugly. Dunno. I agree it's kind of ugly, but it should always work. I think the generic problem is introducing a new unprefixed reserved identifier. Underscored identifiers are reserved. There is already a fallthrough: label used in kernel sources in net/sctp/sm_make_chunk.c that should probably be changed.