Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1906238ima; Mon, 22 Oct 2018 00:14:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV60mY4lG7SffAItjspRRRn4y0YAYugqIQKt/fAqG0poI0yOn1tMIdE6VviMox0tswoBDFCCy X-Received: by 2002:a63:1520:: with SMTP id v32-v6mr42395315pgl.150.1540192451537; Mon, 22 Oct 2018 00:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540192451; cv=none; d=google.com; s=arc-20160816; b=ipJuGu9zEMLM7TxM0JGCZJ6Qsxxp39hdVTqlo/UaY3Vr+FBFTRpoRw3BR3F3WCSQR1 R5CwW4aqy7FYvAofdF9BMQ8pIO+WovVKxNGEBaIyVtcN8788cQBp9hAOeDRk7HARIsgs ZksaNQ2AoyDuFyNXhOSQnk4pzK0Qf9kZnoTJv4hmGXdLB0+X2KfVR5IQ8FpZ7FWmA2og evTSj5sXCv5z1wdRo6h0NdBgrTUWCkUwX4Nq9wH4x9SCI88jUN0TKHQQrHyOMiCV+2rS iHf7fRc5Lh8ig+qffOdWKzRkrxnHTG8T2fQOYp8ylvegXitIFQRXJEFHO88UdpH9dkBd SMMA== 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:to :from:date; bh=U6LA3UR6+zaJ3/NQl4R5ZGzHHcqSRdzpW6V9ld+RkOY=; b=mY6HbnwLpqzTdyP5PrGVj3zyxHT+s+Qp1yXDlHLqKFYb75JO4He1kQnObhO5ufCzUi NeBb57v2rescznOiStpYYigyVBX4nri+UOCJ+Euq3mwpVdW5T/UrGIe4GEJy02AabzyL uyJCuxCwBeJTQwR8iv6MFmkMINrSijgeVyLqDnOZpW1JFxgG82a4pXkAMA/ZroZLx+uZ 0pcTePK1MinxAUru536kJAOYXcww05hZtzxjaCKk060vZdSaI/9qtdu+xqMHteMP696S y1BVhB8WuwhREHVgBnjmZzs32xXJKC+1nUmAHY1WQci55rSCVb280pS4HD4K9AD7PzmU y1UQ== 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 u127-v6si33327972pgc.234.2018.10.22.00.13.54; Mon, 22 Oct 2018 00:14:11 -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 S1727590AbeJVPY0 (ORCPT + 99 others); Mon, 22 Oct 2018 11:24:26 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35374 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727325AbeJVPY0 (ORCPT ); Mon, 22 Oct 2018 11:24:26 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id w9M75l5V022514; Mon, 22 Oct 2018 09:05:47 +0200 Date: Mon, 22 Oct 2018 09:05:47 +0200 From: Willy Tarreau To: "Theodore Y. Ts'o" , Matthew Wilcox , Miguel Ojeda , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Dan Carpenter , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , "David S . Miller" , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Sandipan Das , Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , Paul Burton , David Rientjes , Martin Sebor , Christopher Li , Jonathan Corbet , Geert Uytterhoeven , Rasmus Villemoes , Joe Perches , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , linux-doc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) Message-ID: <20181022070547.GA22454@1wt.eu> References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-2-miguel.ojeda.sandonis@gmail.com> <20181022004217.GA4941@bombadil.infradead.org> <20181022065800.GK1617@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181022065800.GK1617@thunk.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 22, 2018 at 02:58:00AM -0400, Theodore Y. Ts'o wrote: > On Sun, Oct 21, 2018 at 05:42:18PM -0700, Matthew Wilcox wrote: > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > > +#if __has_attribute(__fallthrough__) > > > +# define __fallthrough __attribute__((__fallthrough__)) > > > +#else > > > +# define __fallthrough > > > +#endif > > > > Why is the #else not: > > > > # define __fallthrough /* fallthrough */ > > > > Would this solve the Coverity problem, or does Coverity look at the raw > > source code before preprocessing? > > Wouldn't the "/* ... */" be eaten by the preprocessor before defining > the __fallthrough cpp macro? (e.g., try running the attached script) You're right, even on older versions (4.7 here) : $ echo -e '#define foobar quux /* foobar */\nfoobar\n' | gcc -E - # 1 "" # 1 "" # 1 "" quux Willy