Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7246315ybi; Thu, 1 Aug 2019 05:28:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVbjO+rKwupaFJyhJyvS8pf5YayG52z3ZdjSBokQ752G/p0YV1uv0vvVDaXWj9dQdkqpJ/ X-Received: by 2002:a63:5945:: with SMTP id j5mr118290828pgm.452.1564662497422; Thu, 01 Aug 2019 05:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564662497; cv=none; d=google.com; s=arc-20160816; b=GpbzAlbwC95FP8i/Oy03lZmvfeZYWI6evFoUvu6Nk0gg+QsqlM0xPYz5uGu9cNBCOE Qbufpg7O5gx1Nv3L+V2Mr67n1pWeyMvgULtCoZoQ0ymfZfF5xuufZ+yBJat8qO0S/ynW Wwdalb979bqpvD4o8JJddHyknABV3tvG6hqSS0wjSfsWFh0kGHAaA0IccdZ5C/Q+XJcl H+YJaB2sRavNC/cl6IPVLUKEG5drGRIYzA2I8SyZlHUppABNczB/sSR1154CpNw7hoLw em5ZKABx0Zmg5oS3iQbrDkmuyyJBsW/bvk0lSeeGNX/5O3wJzRrOXO+i4fxfK3A6ziHo qVuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=76PMtUuXYo20gRdBZd0LzwX6gb729ry8PD/6QGfH56E=; b=UeH6NiD/CnXuGFq8wiBaNOMTW1KT1W7C5cSCL2lzRtVGJbVatm5TMPM28Cns0Ph8HB cCSCQiVwxUnBLUkqwQlal8zGCBqEf8VceLNRyBK6IrH+lE3xyS3vkpqM9FtXA9LQUXHL Z2YhleGDHqDacqnYTfyUuR6aGsYQtYRMhwmyUdNxc1uByIkmtwx7lIr8cGuUgOk5cQ8h FBwTlOzRBt2wjVlbrz1z3YeGuXv+4TcbTWMwFh/WC7HowD5hmwhKzjh9taMIuC8KTGjG tvG15ugnBpPwpf4Ztdpo68Jxa252Kc6DIRnAI2VoYocsUD4OZ9azA4VTgeNj3qgLzNuH WhNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rxbEXkfV; 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 31si32077012plz.290.2019.08.01.05.28.01; Thu, 01 Aug 2019 05:28:17 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rxbEXkfV; 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 S1730335AbfHAMZE (ORCPT + 99 others); Thu, 1 Aug 2019 08:25:04 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51402 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfHAMZD (ORCPT ); Thu, 1 Aug 2019 08:25:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=76PMtUuXYo20gRdBZd0LzwX6gb729ry8PD/6QGfH56E=; b=rxbEXkfVTpCSWkHqNVUGWjqW/ G6CbeuNUNEBx2iuuttyC7kmiXyMKvUEn0vH6nT9+5ytMOFMwWmPhk80EXTge3+Ovx+k8kzR4rQVup 0E9Goaug7eD08an9MeWCsTWsNGG/GBc2WHuoELlWGvwzr3yD2IwfZcxcAXJjHnawtI9OUPBj+9D9J 9gVk8otF2fXLA0S/CNL8QcMEabbymgacbnOK8GFrXoy6sShB3CJHOsQCLzq1i8eQrRp35RFQKqNdL i85AHsG9RreuQY4C8GbCzcWaK916qo5l0b0Ilo8fk4/NTFQe3pPOA+JPNVSXr0Scv7IdpxmTFzPqB fyKu2IMcw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1htA8G-0006R3-FR; Thu, 01 Aug 2019 12:24:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8150F2029F869; Thu, 1 Aug 2019 14:24:29 +0200 (CEST) Date: Thu, 1 Aug 2019 14:24:29 +0200 From: Peter Zijlstra To: hpa@zytor.com Cc: Miguel Ojeda , Joe Perches , Pavel Machek , Linus Torvalds , Kees Cook , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "Gustavo A . R . Silva" , Arnaldo Carvalho de Melo , Kan Liang , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Shawn Landden , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , linux-kernel Subject: Re: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use Message-ID: <20190801122429.GY31398@hirez.programming.kicks-ass.net> References: <1d2830aadbe9d8151728a7df5b88528fc72a0095.1564549413.git.joe@perches.com> <20190731171429.GA24222@amd> <765E740C-4259-4835-A58D-432006628BAC@zytor.com> <20190731184832.GZ31381@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 31, 2019 at 11:10:36PM -0700, hpa@zytor.com wrote: > On July 31, 2019 4:55:47 PM PDT, Miguel Ojeda wrote: > >On Wed, Jul 31, 2019 at 11:01 PM wrote: > >> > >> The standard is moving toward adding this as an attribute with the > >[[fallthrough]] syntax; it is in C++17, not sure when it will be in C > >be if it isn't already. > > > >Not yet, but it seems to be coming: > > > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2268.pdf > > > >However, even if C2x gets it, it will be quite a while until the GCC > >minimum version gets bumped up to that, so... > > > >Cheers, > >Miguel > > The point was that we should plan ahead in whatever we end up doing. By reserving 'fallthrough' as a keyword we do exactly that. We can then define it to whatever the compiler/tool at hand requires. Once GCC gains support for that [[attribute]] nonsense, we can detector that and use that over the __attribute__(()) [ Also the Cxx attribute syntax is an abomination -- just a lesser one than reading actual comments :-) ]