From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754241AbdK1UZe (ORCPT ); Tue, 28 Nov 2017 15:25:34 -0500 Received: from gateway30.websitewelcome.com ([192.185.145.3]:44350 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbdK1UZd (ORCPT ); Tue, 28 Nov 2017 15:25:33 -0500 Date: Tue, 28 Nov 2017 14:25:32 -0600 Message-ID: <20171128142532.Horde.i2oBtHDOaD7XV1M3yAL7rga@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Thomas Gleixner Cc: Alan Cox , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, LKML , Kees Cook Subject: Re: [PATCH] x86/syscalls: Mark expected switch fall-throughs References: <20171127235253.GA20384@embeddedor.com> <20171128120512.Horde.1mz61Up1PsNtyHbrjWmK8L7@gator4166.hostgator.com> <20171128122235.Horde.vFP-9ZfAP0f9BFNePB8Z8xi@gator4166.hostgator.com> <20171128190032.2b1fa464@alans-desktop> In-Reply-To: User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1eJmRg-0007a9-52 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:60691 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 2 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Thomas Gleixner : > On Tue, 28 Nov 2017, Alan Cox wrote: > >> > I have no idea who came up with that brilliant idea of parsing comments in >> > the code. It's so simple to make this parser completely fail that it's not >> >> Stephen Johnson (author of the V7 portable C compiler), which is where >> it's from (the lint tool). He also wrote yacc so he does know a bit about >> parsers 8). > > I don't doubt that. > >> > even funny anymore. >> >> The notation in question has been standard in tools like lint since the >> end of the 1970s > > Fair enough. > > Still that does not make the GCC implementation which defaults to take 'any > comment' as valid any better and does not solve other parsing issues which > have been pointed out in various GCC bugs. Using the macro annotation is > distinct and has no ifs and buts. > The thing about taking 'any comment' as valid is false if you add the following to your Makefile: KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough) This option takes the following comments as valid: /* fall through */ /* Fall through */ /* fall through - ... */ /* Fall through - ... */ Comments as fallthru, fallthrough, FALLTHRU are invalid. And of course if you intentionally change the option to: KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=1) it means that you obviously want to ignore any warning. Thanks -- Gustavo A. R. Silva