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