From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58261 invoked by alias); 9 Dec 2015 17:19:10 -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 58216 invoked by uid 89); 9 Dec 2015 17:19:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 09 Dec 2015 17:19:07 +0000 Received: by wmww144 with SMTP id w144so232006604wmw.1 for ; Wed, 09 Dec 2015 09:19:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=p5QzcCeVgUfQBeiryuNd216FiY5mWnuR0b1uRTONflQ=; b=l7ziaadWkjX8AxAy+Yghrqci6rnl+pXeYd8yqHzAp+juuFlecLcIkEcWNY06elVz1P 0LcCqxlWjHlX2nrXrxT+mmjdmQbj5A7MbcVsaq/p6YooqJDbyczRfQnEvqJdkkXLdFo1 wRWmutxSEatuqu7gQWagyqzNWi92mHIYN5flbIqB3jCrKuL1sjTonT+IXMaHCtw2wU62 fsonwGuHT4w0z2qpzuUAjYmWfJXiMwealvIwlLUr8wuauUTRGupOOUzWDGOv5BZZuir2 tDJsn+YR5rDUHndKdGd03mlB7L4fo6ASQCIlXaNCjUeiWAg0alXPxf06QoQEZxpsw5kW dEug== X-Received: by 10.28.18.9 with SMTP id 9mr34056041wms.96.1449681544400; Wed, 09 Dec 2015 09:19:04 -0800 (PST) Received: from ?IPv6:2001:8a0:f91e:8801:2677:3ff:fe1e:aba4? ([2001:8a0:f91e:8801:2677:3ff:fe1e:aba4]) by smtp.googlemail.com with ESMTPSA id l20sm27150397wmd.20.2015.12.09.09.19.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Dec 2015 09:19:02 -0800 (PST) Message-ID: <56686285.50308@palves.net> Date: Wed, 09 Dec 2015 17:19:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Malcolm , Bernd Schmidt CC: Jeff Law , Patrick Palka , Richard Biener , GCC Patches Subject: Re: [PATCH] Add levels to -Wmisleading-indentation; add level 1 to -Wall References: <5637F4A5.1000405@redhat.com> <1449675493-43470-1-git-send-email-dmalcolm@redhat.com> <56684B84.6010906@redhat.com> <1449679792.1916.18.camel@surprise> In-Reply-To: <1449679792.1916.18.camel@surprise> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01036.txt.bz2 On 12/09/2015 04:49 PM, David Malcolm wrote: > This is about managing the signal:noise ratio for something in -Wall. > > The distinction I want to make here is between badly indented code vs > misleadingly indented code. Yes, the code is badly indented, but to my > eyes the code is sufficiently badly indented that it has become *not* > misleading: I can immediately see that something is awry. I want to > preserve the -Wall level of the warning for the cases when it's not > immediately clear that there's a problem. > > The levels idea means that you can turn off the blank-lines heuristic by > setting -Wmisleading-indentation=2. IMHO, the problem with the levels idea will be if/when later you come up with some other orthogonal heuristic to catch some other class of indentation problem, and users want to enable it but not the blank-lines heuristic, or vice-versa. Also, levels don't allow finer-selection with "-Werror -Wno-error=misleading-indentation", IIUC. Did you consider -Wmisleading-indentation=blank-lines,foo,bar instead, or totally separate switches like: -Wmisleading-indentation -Wmisleading-indentation-blank-lines -Wmisleading-indentation-foo -Wmisleading-indentation-bar ?