Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2032917ima; Mon, 22 Oct 2018 03:05:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV62rl1F1VyEjyQlKhniWlWKc6sVbdIvgGufs+S2IriZwxMXeKvYiBvxB5E/4CCyp8a5IggDs X-Received: by 2002:a63:e318:: with SMTP id f24-v6mr13338611pgh.263.1540202703582; Mon, 22 Oct 2018 03:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540202703; cv=none; d=google.com; s=arc-20160816; b=EcY9x+mDdqtVbYZ+5WAyDUmmZ2K0vDioaCl0ysjy657XT3T5Ok6ifLNlPTggzF3sej CgDgTTHW8Y3OCcYnQf0Q1pcDys/Xy7OXS7HnZW14WHldHr1UqnzI9c00pNd79jeDm+ZR D3hDSlOo/beA8YDNGO6PUztG52Njtql8dKBn2xIE9NAxnbSmTMxooRle6q5a0vUNJz6V AlwAQgfvKWxIWYkxOOUx/ibw639sIFBLZSc4u5qehlTvsY+8NPoIZTsfL9+pqd/7Vvus 1pj7SlgXezSNZsFjniP9ZdGGqUScE200ddBrGntfpA9GMVNAySx9EAARXBf4dyfsVqcO 1aRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3H9axaKui5TKJllg9hWj3PLem3zLVXeS0Xjijn0TS88=; b=yU639eHRZkrTPQ22102sdZIlZvxJ8wQhN2KUYX4XIYyg81v75l9VqSJRiRbF3x/H65 Z1wqBgfiNVnuaDrxIVvqakBe5SY3OGhRmsB8i+52IsLQPq0pT/qWvKqFaxE4drAFuYFW lOupvELdI9VZzC5MQpLfLqNcg4HReD2lFrQQYfgpUqAtENO16/3ejq+MXk+9Zzk5KEa4 F2QDvlGZjQBSwynrmRtjubX9W66IOkl4/euE0W6ErLriDxdJ+zeGnvuzGDLnFPkDBm9C wAU+xwAEThycqIF3BVb8PjEDs8FtnGSKyvE7+F8StVuUd3X+TyAn+Xw/S40Hkg7TYCu1 eEtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fGZ2cra+; 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 l26-v6si34853356pgb.251.2018.10.22.03.04.49; Mon, 22 Oct 2018 03:05:03 -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=fGZ2cra+; 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 S1728017AbeJVRoY (ORCPT + 99 others); Mon, 22 Oct 2018 13:44:24 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46711 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727550AbeJVRoY (ORCPT ); Mon, 22 Oct 2018 13:44:24 -0400 Received: by mail-lj1-f196.google.com with SMTP id x3-v6so36265419lji.13; Mon, 22 Oct 2018 02:26:40 -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; bh=3H9axaKui5TKJllg9hWj3PLem3zLVXeS0Xjijn0TS88=; b=fGZ2cra+hf6+AwhL4gEZ+VCymGmieYOZcFMC83YSKlx16RDIM1Kp6+01xlHOSVAjuO b9mG/O+FEvGxc/AKWU+NazQcv8CGIw1QFhgFySh8ZcuEBfucemVsEEVqfEjOMR5bUrz+ RCdjkPIr+shBI2MfHKa2TfQcAmQiPhum3bFxPs6I+8yxuro22Hijm0W/qXbMxAcpVg99 3sZOiMxMy3hHIrwei9yYAN0sfI3m20GEAEhr/7+gbcD6guCRk4rgzZusvte8cnHOUom1 g3nQqAFfxMqmii02mA5rYNPLu6j/vbph1Fkt5vcxLgn1S6GI126oJVBlQqWzRzTQkhR9 WFEQ== 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; bh=3H9axaKui5TKJllg9hWj3PLem3zLVXeS0Xjijn0TS88=; b=TTrJtY4YPlInZU2tW34+LkFZcCI0o47OodXm5eguVhppojcDNGJ+TjMgoJh24WMYlT KZQXerAvVOZVzfLhVyctbmjqbar4gOPcKT5cz8Bfh+T4fZ5S1brMd3z7zEqsWXIuVPyg mT2l74fdB40VGeP18qUhb/IE1nb6lRcwkbBr9lhv59Gjpj40fb//5b/S8hoYUmZagxV3 JNREjAdLFdTxM7BeoYeQLTI2BL+5yhgYsPo+7Mf2iJzF1lXjixuzhzcdJws+TeF5l7wl sKKQ4loMfo2OAlGpoeTL0r6lC8QUgTyFc2iZMzuil/LUPJ8emmKaGg+Qa+7f31ydJxro XpXQ== X-Gm-Message-State: ABuFfojBvPlQU8/M9fuQmgoTPsBWkJ93vn+xT+I0YIGNhuP+TMDRLKsz 8ArD03OOacyZOubsXhJBHKKOwmcj83FqSDlORi0= X-Received: by 2002:a2e:6e08:: with SMTP id j8-v6mr31545836ljc.61.1540200399659; Mon, 22 Oct 2018 02:26:39 -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: <20181021222712.GI1617@thunk.org> From: Miguel Ojeda Date: Mon, 22 Oct 2018 11:26:28 +0200 Message-ID: Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) To: "Ted Ts'o" , 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 , 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 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? 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