Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2035664ima; Mon, 22 Oct 2018 03:07:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5eXGXif5IGzFyHWbkVS2WbdWXDSWYLcbCs1tnKJj3xFa9QN43b9+D47DpPyGZQeJjgmq+FT X-Received: by 2002:a63:6848:: with SMTP id d69-v6mr4174076pgc.113.1540202873850; Mon, 22 Oct 2018 03:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540202873; cv=none; d=google.com; s=arc-20160816; b=FZ9U8P2nCfYUT/XtoGJHnTmp3sjPGUm8tIu7z/RV4WeitvDF2prKje05lBNjfbrTwN Ux4Pzv6PsR/tjT4FRockOorKZ1rAapSBXEtzJe6MaSNpKrZQ7Gn6onT4g1bTs3G1aypX 0ctSEqh3xhq7QdnL/YQB6of2mtimsyg5PSLZWK7gQvBo+thbO5D3VdN5ielOHy6u3GAd pzRyFcHZPkTemDLDdS8oOKNGAm0rjQ/OEyEkWdKq/cHWJkIFTOfOtnJfMrkeYltsIaWO Ph7J7SXNbU1+foWac6Vec3cdWR/pFjv/7bmVKXRSog3iB1xpxCeGAKeaSEpzmdffD0dx 5m5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DoeTa8clP94vb0y/U8jIPON2PaapmjHGUcCLCmMk7Vw=; b=y0Qm5YckKflNCS2Hje2HurQsnB+m5jOJfzQAjgqLOWisWaLmo3c0lJ4DJmnK/1Ov/W y2CaLL9ahYA/W1fxcYUn+ebyT+o6He/a+rYBTECRnh+WwOkVvuVXvNSfhVI/91Z7rUB7 Rf8Dq2T9c/Nv2tYTEnhlrq6ljL3Ntfq8HcNBwhcFqfVFywjgtzGQz1HPQHM+ruG9VZUM vvpTTc/BGZpd2xXW4b/DlkYHFXDjbxSBQvX+ZP+ZFf4HqCvU5Ka7HEEbDZLAIDMh9KtM 4HXUPee98eVsKtNNor7k0IHMFnCiZFNc+dqJOqB0gWjn1fU6iiGUiCB/dAGO9BMCbQQ1 6igw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qQyZUtHR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t30-v6si19590200pgl.452.2018.10.22.03.07.38; Mon, 22 Oct 2018 03:07:53 -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=pass header.i=@gmail.com header.s=20161025 header.b=qQyZUtHR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728161AbeJVRu1 (ORCPT + 99 others); Mon, 22 Oct 2018 13:50:27 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44895 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727523AbeJVRu0 (ORCPT ); Mon, 22 Oct 2018 13:50:26 -0400 Received: by mail-lj1-f195.google.com with SMTP id v6-v6so36274426ljc.11; Mon, 22 Oct 2018 02:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DoeTa8clP94vb0y/U8jIPON2PaapmjHGUcCLCmMk7Vw=; b=qQyZUtHRAuOAxVghkpd5ekwLMIYwHHJ34u0szYP27d6r2YhoBkjyOFsNslNL3Xfe4O aUl6FhmstaLwh7TAOybQC0cnAQyyC8fT8Hm6wsIRRXzqTbByKLDIoB2ifb/I7uAiN1US 5dHIIGWegYh5CKyVo/D/9xIbh7gyDAQ2WxhLHGYKXk209U/z+R9IN7nyWnQiwZ4jC26i B5CVldbOB4leqhUIc1+GuQUgjcmb9gfFRTWNS66wnTfiP3RwcC3OnJ3SStHreD9SPytD iZNRLRJVHFvIrfAlZ5DAY1hPN9Qmqo4ZVsbS74YQIE4LZ9VbkXspL29cvK6DK3cj3AbF p0mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DoeTa8clP94vb0y/U8jIPON2PaapmjHGUcCLCmMk7Vw=; b=lkgOs4hNWjpvJMwjVy6ULL4UUeoK/S5FQPcWIjOdfHV1PgrKPR27tjtunyBpMBnHIA Cm3TeTwyJYUkC3yTJBuXNNt8E354gMdtHo2driF8loMbK11YVuabF1EuxpgPvASu+Yxp AsHHsAB9V16QE8METMuJYakoIb9/33nsZc4s6axTnfvn18/TDsWYCEGVe43cnEbnPQ7T 49IFsScDjDuWHWUwyQUyN/QbZYDIqax2IJ5lJzIGfNkk/lfTHWcNs3ZPFLW5krjwJDwp iHr0J8ekoVzhcMR+20ScrVVQpMspeAX34fFPZfSzpfl3np5fsjbmYg42vQsHAmg5hwNY VSMw== X-Gm-Message-State: ABuFfojK3VH2yvsjL/koIKGi9rpLqPFtGfrDLvu7M4BJ19p1O8VtJNe9 iUDugltC/x5LvrHAe1IHMKqa3W/0x7dZxw+jBRA= X-Received: by 2002:a2e:9d7:: with SMTP id 206-v6mr31349614ljj.127.1540200761001; Mon, 22 Oct 2018 02:32:41 -0700 (PDT) MIME-Version: 1.0 References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-2-miguel.ojeda.sandonis@gmail.com> <20181022004217.GA4941@bombadil.infradead.org> In-Reply-To: <20181022004217.GA4941@bombadil.infradead.org> From: Miguel Ojeda Date: Mon, 22 Oct 2018 11:32:29 +0200 Message-ID: Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) To: Matthew Wilcox Cc: Greg KH , linux-kernel , Dan , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , David 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 , Willy Tarreau , Martin Sebor , Christopher Li , Jonathan Corbet , "Ted Ts'o" , Geert Uytterhoeven , Rasmus Villemoes , Joe Perches , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , Linux Doc Mailing List , Ext4 Developers List , linux-sparse@vger.kernel.org, linux-kbuild@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 2:42 AM 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? That wouldn't work if Coverity follows the standard, because it is required that comments are removed right before the preprocessing phase. That is one of the advantages vs. the attribute that I mentioned: """ We can actually use a #define for it like for the rest of attributes/extensions, which is not possible with a comment, (...) """ Cheers, Miguel