On Wed, 20 Aug 2014, Sylvestre Ledru wrote:

> On 20/08/2014 00:02, Joseph S. Myers wrote:
> > On Fri, 15 Aug 2014, Sylvestre Ledru wrote:
> >
> >> It is indeed useless. I removed it. Thanks
> >> http://sylvestre.ledru.info/0001-Enable-warning-Wreturn-type-by-default.patch
> > I don't think most of the testsuite changes in this patch should be 
> > needed, and we should be conservative about changing existing testcases 
> > because of the risk that it affects what they test.  Most of the changes 
> > seem like they would only have been relevant for the previous version that 
> > enabled -Wmissing-return warnings by default.
> >
> > The change to gcc.dg/c90-impl-int-1.c is simply wrong - the specific point 
> > of that testcase is to test various cases of implicit int, so you can't 
> > add explicit int return types to it.
> >
> > You need, obviously, the new tests for how -W(no-)missing-return and 
> > -W(no-)return-type work and what the defaults are.  Existing tests should 
> > only need to be changed if they do in fact fail with the compiler patch 
> > applied.
> >
> Thanks for the feedback.
> I updated the patch (including the gcc.dg/c90-impl-int-1.c change):
> http://sylvestre.ledru.info/0001-Enable-warning-Wreturn-type-by-default.patch
> 
> For information, the number of files modified by this commit dropped
> from 1298 to 818.

Are you sure that's the right patch?

* It seems to be missing the new testcases, which are a necessary part of 
the patch.

* The first few testcase changes I looked at in the patch still don't make 
sense to me.  They are changing int return types to void, or adding 
"return 0;", which should not be needed with the defaults as I understand 
them - the warnings for those should be the "control reaches end of 
non-void function" which I thought was being left off by default.  If 
those are getting warnings (for C) without the changes, there's something 
I still don't understand about what this patch is doing and why it's meant 
to be safe.

Could you clarify - in terms of source code constructs, not option names - 
which cases your patch would or would not cause to receive warnings by 
default for C?

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to