From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22130 invoked by alias); 12 Apr 2012 15:33:24 -0000 Received: (qmail 22118 invoked by uid 22791); 12 Apr 2012 15:33:23 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 15:33:10 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3FE3D1C6BFA; Thu, 12 Apr 2012 11:33:09 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OVRhJlSxtGqI; Thu, 12 Apr 2012 11:33:09 -0400 (EDT) Received: from [192.168.77.102] (cpe-69-204-224-43.nyc.res.rr.com [69.204.224.43]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 8F9391C6BF8; Thu, 12 Apr 2012 11:33:08 -0400 (EDT) Message-ID: <4F86F5B0.2020207@adacore.com> Date: Thu, 12 Apr 2012 15:33:00 -0000 From: Robert Dewar User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Gabriel Dos Reis CC: Dave Korn , gcc@gcc.gnu.org Subject: Re: RFC: -Wall by default References: <201204091929.52330.ebotcazou@adacore.com> <4F831FFB.9050407@adacore.com> <20120411085055.GD12165@xvii.vinc17.org> <4F86AD2F.4010506@gmail.com> <4F86E8FE.20407@adacore.com> <4F86EACE.9070301@gmail.com> <4F86EE3F.3050804@gmail.com> <4F86F1C9.3070505@adacore.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00505.txt.bz2 On 4/12/2012 11:23 AM, Gabriel Dos Reis wrote: >> less warnings to more warnings, what could be more >> ordered than that! > > What exactly do you put in -Wn to make it give *more* warning? > I can think of a reduced number of switch that would give you > more warning on a specific program without them being terribly > useful. It's JUST like the optimization case, you use a higher number to get more optimization. Yes, there may be cases where this hurts (we have seen cases where -O3 is slower than -O2 due to cache effects) For warnings you put a higher number to get more warnings. Yes, you may find that you get too many warnings and they are not useful. Remedy: reduce the number after -W :-) >> -On means more optimizations for higher n, simple enough? > > like the traditional -O2 vs. -O3? Right, -O3 does more optimziations than -O2. Of course there might be cases where this doesn't help. I bet if you look hard enough you will find cases where -O1 code is slower than -O0. For -O, we do not guarantee that a higher number means faster code, just that more optimizations are applied. for -W, we do not guarantee that a higher number means a more useful set of warnings, just more of them.