This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] PR55189 enable -Wreturn-type by default
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Sylvestre Ledru <sylvestre at debian dot org>
- Cc: <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 17 Jun 2014 17:15:31 +0000
- Subject: Re: [Patch] PR55189 enable -Wreturn-type by default
- Authentication-results: sourceware.org; auth=none
- References: <538F7856 dot 1090104 at debian dot org> <Pine dot LNX dot 4 dot 64 dot 1406042321130 dot 2874 at digraph dot polyomino dot org dot uk> <53903961 dot 9030501 at debian dot org> <Pine dot LNX dot 4 dot 64 dot 1406051749260 dot 2819 at digraph dot polyomino dot org dot uk> <53A07226 dot 4040803 at debian dot org>
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. 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).
--
Joseph S. Myers
joseph@codesourcery.com