From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70033 invoked by alias); 29 Oct 2015 17:38:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 70024 invoked by uid 89); 29 Oct 2015 17:38:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 29 Oct 2015 17:38:05 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 88E22C0A5248 for ; Thu, 29 Oct 2015 17:38:04 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-196.phx2.redhat.com [10.3.113.196]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9THc4NS002340; Thu, 29 Oct 2015 13:38:04 -0400 Subject: Re: [PATCH 4/4] Add -Wmisleading-indentation to -Wall To: David Malcolm , gcc-patches@gcc.gnu.org References: <1446137381-32748-1-git-send-email-dmalcolm@redhat.com> <1446137381-32748-5-git-send-email-dmalcolm@redhat.com> From: Jeff Law Message-ID: <5632597B.2020205@redhat.com> Date: Thu, 29 Oct 2015 17:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1446137381-32748-5-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg03247.txt.bz2 On 10/29/2015 10:49 AM, David Malcolm wrote: > Our documentation describes -Wall as enabling "all the warnings about > constructions that some users consider questionable, and that are easy to avoid > (or modify to prevent the warning), even in conjunction with macros." > > I believe that -Wmisleading-indentation meets these criteria, and is > likely to be of benefit to users who may not read release notes; it > warns for indentation that's misleading, but not for indentation > that's merely bad: the former are places where a user will likely > want to fix the code. > > The fix is usually easy and obvious: fix the misleadingly-indented > code. If that isn't an option for some reason, pragmas can be used to > turn off the warning for a particular fragment of code: > > #pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wmisleading-indentation" > if (flag) > x = 3; > y = 2; > #pragma GCC diagnostic pop > > -Wmisleading-indentation has been tested with a variety of indentation > styles (see gcc/testsuite/c-c++-common/Wmisleading-indentation.c) > and on a variety of real-world projects. For example, in: > https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg119790.html > Patrick reports: > "Tested by building the linux, git, vim, sqlite and gdb-binutils sources > with -Wmisleading-indentation." > > With the tweak earlier in this kit I believe we now have a good > enough signal:noise ratio for this warning to be widely used; hence this > patch adds the warning to -Wall. > > Bootstrapped®rtested with x86_64-pc-linux-gnu. > > OK for trunk? > > gcc/c-family/ChangeLog: > * c.opt (Wmisleading-indentation): Add to -Wall for C and C++. > > gcc/ChangeLog: > * doc/invoke.texi (-Wall): Add -Wmisleading-indentation to the > list. > (-Wmisleading-indentation): Update documentation to reflect > being enabled by -Wall in C/C++. I'm sure we'll get some grief for this :-) Approved once we're clean in GCC. I'm going to explicitly say that we'll have to watch for fallout, particularly as we start getting feedback from Debian & Fedora mass-rebuilds as we approach release time. If the fallout is too bad, we'll have to reconsider. I'll pre-approve patches which fix anything caught by this option in GCC as long as the fix just adjusts whitespace :-) jeff