Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2762055ima; Mon, 22 Oct 2018 15:42:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV60vrgZvowGQPuJu6d6jF9eyARKgcSmXgCC99FFcAVYBTTiJkyzosGroNvd4B56SJF2qE+4w X-Received: by 2002:a17:902:4e:: with SMTP id 72-v6mr45716315pla.204.1540248174280; Mon, 22 Oct 2018 15:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540248174; cv=none; d=google.com; s=arc-20160816; b=Y0PAS6RAJHo7+2M4L/R5CftY7V/wFTrXxgOC4IKOZcnF40n3UeYl82bHeiCMUMAhrS 6a5zO26lTECMVYFQ7pHZyrAhNYXe25HoIjRm0v9O7TwG5SqIGfbSHb2W+p/TTkudGYpY gJjQ6tk19iUSuqD9bymJ4cUgC/A1A4avULOvr9ai4ZdxxpZEwYaGoXlpH8z7doiV80Zw hLISPwa6qWu9Vm67BHoW11dNBvHJOZcwsckl3MJf0Zg5q6RGuPZKkQ/fXPRnHmyWXwYH tJSqetp5zHwaUTnMWH1KUXvVP2yVvohNF9x8yQ+4hJjbiXlKpF0X+HdPi/uClSjSpvn5 2xxQ== 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=1/Yc5JujtwwX0NbKIXymg5eBpo08pcsE417gJv5ehyo=; b=vZ7fXZkPnS6IxpCGskpTndzUtcLyB/kPM/fruRP3IhILDWIeO2jmjhJ+gWBcpcg8vl BVXs95M6RXlG3wx68i/wmAosh/cFK99hKx2zhKagF07kSuBveMf4xHw2ifCWmZ3QB65J iPQmI8BS3HGzbYN4tK+ZHxXRAv2Hx6a14BbJ9E5f5NWBWYv2NL4uz185fRaML8jCflFw Ai2qjhrpiEsCv2Ez/ksy2dbQ/cVWzUNtQP0i/7saEIe3DYWy61wbbwhhgM3GvejNqPWX 4HNK5510MCbzMHj5NYOKyd0gNYRRsDKB9scv7ch5+pIkqYtVrisI0bwx0/RWoXMWAKZH P55A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tfEZ1oYO; 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 z14-v6si10798030plo.412.2018.10.22.15.42.38; Mon, 22 Oct 2018 15:42: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=@gmail.com header.s=20161025 header.b=tfEZ1oYO; 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 S1729356AbeJWFhm (ORCPT + 99 others); Tue, 23 Oct 2018 01:37:42 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39325 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbeJWFhm (ORCPT ); Tue, 23 Oct 2018 01:37:42 -0400 Received: by mail-lf1-f68.google.com with SMTP id p11-v6so5138232lfc.6; Mon, 22 Oct 2018 14:17:27 -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=1/Yc5JujtwwX0NbKIXymg5eBpo08pcsE417gJv5ehyo=; b=tfEZ1oYO5tGKNQrp1HHoF0K4QtOllE4VXQiZX3AiD1WisMc4s2Srwz0kwfNlNE5ZFr WmgmOKYsKn9pMiNuef8WfcWVChge0Rn6lKoGEBRplKwBwP1qCqx3tqZhCzrpJpI7PuzI rwKgmzdLLvfGfqcCDTPLpA8+0WaAYsdvqyeGzcIp9ninIm4u7qtGVKNh95W8pAxisx5h cJaEkiI2tCbsa3Wd/E25w0zJzarVTvsoGO5AsGNCM0CAlbeGMbEDNJQUnNHmr6xpZG0D 2JxY04sen5SB//4+Fux5tTA22LRPjjrUVd7IvRKvtxDPlurD2vR+NskJO15x6vw+ViFD 0FFw== 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=1/Yc5JujtwwX0NbKIXymg5eBpo08pcsE417gJv5ehyo=; b=hISRdJOtda6XDGu3PnLOiDuR3VwXSqmf9pCxxaVZYERKTjhmwgv45dMInrlWCRmncM Sb4/+BcCozwNiOKgfo/ZbPjmtQJixLGX+oMEFWcRFjY1fiyuoZ6QKPvTOwL5SwfiDtlm 1ARQy6IwHs4JXcPqi2CGdKRj8Y830NOddxZvayKoNlwEjJ0QjMhzdTPjuEVmWYlQpFoE cWh2oC5FaLe2lRbQ1UR8bTEQuBDQFhCQF5w9BcZao4jGJMpp1dku3nR394tFAy+H1Z8O NTEwiWa+k3iN0z0BvjN3GRoRLi/Xzo8/eKNbGLZbRFHmGr3OYoSd4ekDf77QYGVAe437 NIQQ== X-Gm-Message-State: ABuFfoi947X14ZkGws1a8hZuGjvz59qWGaKQj8zYmWDJbWzN/vuecprn 96FdLWGaHsO8kjPWkuJv2at+RUyiHAIQCF0FffPlrh2H0MQ= X-Received: by 2002:a19:6b16:: with SMTP id d22-v6mr10373152lfa.49.1540243046845; Mon, 22 Oct 2018 14:17:26 -0700 (PDT) MIME-Version: 1.0 References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-2-miguel.ojeda.sandonis@gmail.com> In-Reply-To: From: Miguel Ojeda Date: Mon, 22 Oct 2018 23:17:15 +0200 Message-ID: Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) To: Nick Desaulniers 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 , 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 7:36 PM Nick Desaulniers wrote: > > On Sun, Oct 21, 2018 at 10:14 AM Miguel Ojeda > wrote: > > > > of its kind) to deal with this: [[fallthrough]] is meant to be > > a new control keyword in the form of an extension. > > I think we can leave the details about the [[]] notation out. IIUC, > it's only applicable to C++. No, because C++ is the driving force for the standard attributes syntax; i.e. C2x is adding them because of the syntax published by C++17; and possibly gcc 7.1 added support for fallthrough (and comment parsing) due to C++17 too. Basically, it is a small paragraph explaining how this came to be. > > +#if __has_attribute(__fallthrough__) > > +# define __fallthrough __attribute__((__fallthrough__)) > > +#else > > +# define __fallthrough > > While this is in the correct format as the other attributes in this > file, I think this particular attribute is a special case, because of > the variety of fallbacks and differing support for them. I'd like to No, is it the correct format because we cannot add support for the other syntax in gcc; so the best way to proceed is to simply wait until clang supports the GNU attribute in C mode. The tooling, of course, is another matter and independent of this. > see in the commit message maybe a list of tools we'd like to support Yes, I already said I would write it in one of the other threads. > and links to the feature requests/bug reports for them. I acknowledge > it's more work to file bugs, but it's being a good open source > citizen, IMO. Who said we aren't going to do it? :-) I was actually in the process of checking which OSS tools supported what and how easy it was to fix in each of them (gcc's [[...]] syntax, clang's GNU and C++ attrs in C mode, cppcheck's fallthrough support...), but it takes time; I prefer to do the research beforehand; so that the submitted bug reports are better/more precise/more helpful, etc. However, you already sent the LLVM report (without mentioning this thread or me, nor the -fdouble-square-bracket-attributes clang flag that I mentioned). That is a bit rude :-) Please take things a little easier, there is no need to rush stuff. If I didn't have submitted the LLVM bug report is because I hadn't finish looking at the issue. In general, I think it is polite (and also more productive to avoid duplicating efforts) to first ask whoever is working on something before you rush to do it... > > I'm also curious which is the first version of GCC to support the > comment format? gcc 7.1 started everything. It is stated in the commit message and several messages/threads already. Again, please pause, relax and read a bit before sending stuff around :-) Cheers, Miguel