Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2506553ima; Mon, 22 Oct 2018 10:52:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV62VrEcWU/uGyTGSNiyaV6jqTi6iuyRHo4PKIPQ5FdCmMJcy3eNjAU+ZCIVbqpzlX7GnwVR7 X-Received: by 2002:a62:3641:: with SMTP id d62-v6mr37575481pfa.97.1540230774646; Mon, 22 Oct 2018 10:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540230774; cv=none; d=google.com; s=arc-20160816; b=RXmKVB1DQ7WQN7B1xUJaRY9PdrvOIEjCuc1zasW7iB+MCX7pwovIYK2zQRrZt8iGfm HGn+OkQHcNmXNu6a/NF08IT4C53MLybbvKIAmDwJT55b6CZ0gEQrf4VckXYbePRRyKgq dYwCbVROW8GYxrKs9CpRpNH+F1T3Ur4n6F2OZ78c5ys+aVKogChh291QCn0lJ0WcJt2N s4N9Y+m19U0EIQhY3EAjo+TZqjAcYsMcd2dexRAstgjPXB22UvBZflqvJf7T5nfeOSU/ EqLmkm7op11PtdgpakCNaApNznCgOB+7xI2OTxOe/0f0vwjQ1XoOiFNw8XRs6x0DDFZK M2ZQ== 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=hztU8N/gq+fgPc7miLD7Wh6snFgsCBQikLZ9/v92tvU=; b=RIsZzfqMk05nPNGdgyh0Ihov/SMJvNFe9k6yqr/Y3mY4neL4f45j98kFAJblgYDirg jxNde4N5RI39XqTnAcskrlKmNTPglRnWp5eb8qxKu7Ig/xUq0hmDUt/sTCl/rKqP66Pt 9h4wcmAdWuO0HPy0aBOvi/L7WOnexweViq4kBp52A9NR3++6dfOHVPy7XOZf4ULNOv5m 2f4SmoJVxgG1BzBDPbAmFGm7HD6bW53jQOEvGvLpL8C6SD6CQLYsXDtzWFgIVpNfsWGr 0T3dQkZhYE+Bx0gpT5+Q6cM7x6HXtPDlVxupAWdKRemnsScyDvGxQbMq4yAS2YlnEG8p OXnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qesZ2z62; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8-v6si35465192pfx.185.2018.10.22.10.52.39; Mon, 22 Oct 2018 10:52:54 -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=@google.com header.s=20161025 header.b=qesZ2z62; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728757AbeJWBmu (ORCPT + 99 others); Mon, 22 Oct 2018 21:42:50 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41454 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728639AbeJWBmt (ORCPT ); Mon, 22 Oct 2018 21:42:49 -0400 Received: by mail-pf1-f196.google.com with SMTP id m77-v6so20245922pfi.8 for ; Mon, 22 Oct 2018 10:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hztU8N/gq+fgPc7miLD7Wh6snFgsCBQikLZ9/v92tvU=; b=qesZ2z624uj3vkvmSA8VhC0FmIi2lbxjdmQ7rDowO8JR0icAkybm6Kq/4LwDGjk725 QJEopbgDeI7DblLc1EyapaAsu7rV/tNKSXmOgSjwqqddv8acT3f9qOkFonzgpgs2ZxNp Z8U05jOvG80EM8zfNNAf7+N78cVegB0pAWSjj1yHDMun+RrYsFAfedr83i7jFFci+jLl n8kSStyJBrVLzSWVclW2ZEolL2oazN9mp1TkBXiX25QpXhKXLxiQ9pj0juCezRovcqH3 hc4gnm+DR2Uek1sfYgyLcBfwNat7/ExEi0OYhiC/qEtZmpglR6kYSk9sH/SFRO9wXOLQ 23eg== 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=hztU8N/gq+fgPc7miLD7Wh6snFgsCBQikLZ9/v92tvU=; b=mnR+nMzIfjhPYdpvv0ws/a2qUKQNhx/innBl0f39yuV+zQ3QZP1ME8v6M5qtMxJvjp jXvijc5JLa8woifSXPggX+81DEzyIXUHdfjXZtftwNxtwy1/aaipvlsDPPMECOJNpTdG IoB1IH5VsoLTvtIeBU9GVLh6lURHvoWflBVXUtzfhBhoiQGqtunBVZCb+5CQ8WGinC1v iRA/yupXWKJZjLlvGgYmu/k9tk/Afgeb9oa9OZJqeQKqnEkV113S+W5jRp/wgbMXFJw7 C54zqvYq8/1KEi+thmbb8qSH3gD947ft/KxtftMnRS9UOpuaHazCjBCZLaEXZivMgl1t d3WA== X-Gm-Message-State: AGRZ1gLuBMGDXWrUu9RWijv/7Qwv1NHM3xM9W9yKVZkZVcEnJdjniD3W 6uHqqOsdD3Hig6neHd/XFqCxUEVkHLNCN1wpG65S+A== X-Received: by 2002:a63:42c1:: with SMTP id p184mr1388980pga.202.1540229005714; Mon, 22 Oct 2018 10:23:25 -0700 (PDT) MIME-Version: 1.0 References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-2-miguel.ojeda.sandonis@gmail.com> <20181021222712.GI1617@thunk.org> In-Reply-To: From: Nick Desaulniers Date: Mon, 22 Oct 2018 10:23:14 -0700 Message-ID: Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) To: Miguel Ojeda Cc: "Theodore Ts'o" , Greg KH , LKML , dan.carpenter@oracle.com, adilger.kernel@dilger.ca, Masahiro Yamada , Michal Marek , rostedt@goodmis.org, mchehab+samsung@kernel.org, olof@lxom.net, Konstantin Ryabitsev , "David S. Miller" , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , sandipan@linux.vnet.ibm.com, Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , paul.burton@mips.com, David Rientjes , Willy Tarreau , msebor@gmail.com, sparse@chrisli.org, Jonathan Corbet , Geert Uytterhoeven , Rasmus Villemoes , joe@perches.com, Arnd Bergmann , asmadeus@codewreck.org, Stefan Agner , Luc Van Oostenryck , Andrew Morton , Linus Torvalds , linux-doc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, Linux Kbuild mailing list , Colin Ian King 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:26 AM Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 12:27 AM Theodore Y. Ts'o wrote: > > > > On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote: > > > From the GCC manual: > > > > > > fallthrough > > > > > > The fallthrough attribute with a null statement serves as a > > > fallthrough statement. It hints to the compiler that a statement > > > that falls through to another case label, or user-defined label > > > in a switch statement is intentional and thus the -Wimplicit-fallthrough > > > warning must not trigger. The fallthrough attribute may appear > > > at most once in each attribute list, and may not be mixed with > > > other attributes. It can only be used in a switch statement > > > (the compiler will issue an error otherwise), after a preceding > > > statement and before a logically succeeding case label, > > > or user-defined label. > > > > > > https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html > > > > Do we know if coverity understands the fallthrough attribute? One of > > the reasons why I started using /* fallthrough */ is because it kept > > Coverity happy. > > If Coverity is like gcc, they should be doing both (i.e. I see the > comment parsing as an "extra" that gcc did, but the "basic stuff" is > the attribute -- and I would guess it is way easier for them to > support than the comment parsing). > > But I cannot test it myself :-( Someone, please? + Colin, who has been running Coverity on the kernel, and sending patches. > > However, if I understood Greg correctly in his reply to the cover > letter, he replied that Coverity knows about it (?). > > > > > If the conversion from /* fallthrough */ to the __fallthrough__ > > attribute means that we start gethting a lot of Coverity warnings, > > that would be unfortunate. OTOH, if this is getting standardized, > > maybe we can get Coverity to understand this attribute? > > Indeed! That would be the best for everyone, including Coverity customers. > > Cheers, > Miguel -- Thanks, ~Nick Desaulniers