Return-Path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:45980 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728763AbeJWBhS (ORCPT ); Mon, 22 Oct 2018 21:37:18 -0400 Received: by mail-pl1-f195.google.com with SMTP id o19-v6so3588352pll.12 for ; Mon, 22 Oct 2018 10:17:57 -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:17:44 -0700 Message-ID: Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) To: Miguel Ojeda Cc: Kees Cook , gustavo@embeddedor.com, "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 , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org List-ID: On Mon, Oct 22, 2018 at 2:43 AM Miguel Ojeda wrote: > > On Mon, Oct 22, 2018 at 11:41 AM Miguel Ojeda > wrote: > > > > * clang does *not* support the attribute in C. > > ...nor the warning at all, by the way (which is why this is OK). > > Cheers, > Miguel Oh? We're going through and annotating all of Android's C++ source right now with it. https://clang.llvm.org/docs/DiagnosticsReference.html#wimplicit-fallthrough Though it looks like the attribute syntax I like from GCC is not yet supported in Clang. https://bugs.llvm.org/show_bug.cgi?id=37135 https://github.com/ClangBuiltLinux/linux/issues/235 I'll take a look at adding support. So Kees sent me this embarrassing example: https://godbolt.org/z/gV_c9_ (try changing the language from C++ to C; it works)! That's embarrassing! https://bugs.llvm.org/show_bug.cgi?id=39382 https://github.com/ClangBuiltLinux/linux/issues/236 Will get these both fixed up. -- Thanks, ~Nick Desaulniers