From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9548 invoked by alias); 17 Jun 2014 17:37:39 -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 9539 invoked by uid 89); 17 Jun 2014 17:37:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: batou.ecranbleu.org Received: from batou.ecranbleu.org (HELO batou.ecranbleu.org) (88.190.32.89) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 17:37:36 +0000 Received: by batou.ecranbleu.org (Postfix, from userid 999) id BFEB0122578; Tue, 17 Jun 2014 19:37:02 +0200 (CEST) Received: from [192.168.12.5] (unknown [192.168.12.5]) (Authenticated sender: sylvestredeb@ledru.info) by batou.ecranbleu.org (Postfix) with ESMTPSA id 76188122502; Tue, 17 Jun 2014 19:36:52 +0200 (CEST) Message-ID: <53A07CCC.2030004@debian.org> Date: Tue, 17 Jun 2014 17:37:00 -0000 From: Sylvestre Ledru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: "Joseph S. Myers" CC: gcc-patches@gcc.gnu.org, Jason Merrill Subject: Re: [Patch] PR55189 enable -Wreturn-type by default References: <538F7856.1090104@debian.org> <53903961.9030501@debian.org> <53A07226.4040803@debian.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg01369.txt.bz2 On 17/06/2014 19:15, Joseph S. Myers wrote: > On Tue, 17 Jun 2014, Sylvestre Ledru wrote: > >> On 05/06/2014 20:01, Joseph S. Myers wrote: >>>> Initially, I implemented -Wmissing-return to manage this case ( >>>> https://gcc.gnu.org/ml/gcc-patches/2014-01/msg00820.html ) but Jason >>>> suggested to remove that: >>>> https://gcc.gnu.org/ml/gcc-patches/2014-01/msg01033.html >>>> (I don't have a strong opinion on the subject). >>> I think splitting the option like that makes sense. Compatibility >>> indicates that -Wreturn-type and -Wall should still enable >>> -Wmissing-return, but only the other pieces of -Wreturn-type should be >>> enabled by default, at least for C. (Enabling -Wimplicit-int by default >>> might be a good starting point.) >> OK. >> As attachment, you will find a potential implementation. Is that what >> you expect? > It would help a lot if it included testcases for what various options / > option combinations do / do not enable. OK. I will do that. We should test the following: * default => run just -Wreturn-type * -Wreturn-type => Run both * -Wreturn-type + -Wmissing-return => Run both * -Wno-return-type + -Wmissing-return => Run just the second one * -Wno-return-type + -Wno-missing-return => Run none Do you see any other? > I expect that each option > continues to enable the warnings it does at present (so if a user > explicitly does -Wreturn-type it also enables the -Wmissing-return > warnings, for example) - but some warnings would start to be enabled by > default. If someone does e.g. -Wno-implicit that would disable the > default -Wimplicit-int; if they do -Wno-implicit -Wimplicit that would > have the same effect as just -Wimplicit (so keeping the default warnings > enabled, and possibly enabling others). > OK. I will try to implement that later (I don't think -Wimplicit-int is necessary to enable -Wreturn-type by default). Besides that, are you OK with my changes? (with the tests updated) Thanks, Sylvestre