This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Enable -Wreturn-type by default ?


On 01/16/14 04:45, Jonathan Wakely wrote:
On 16 January 2014 11:11, Sylvestre Ledru wrote:
Hello,

On 17/11/2013 17:47, Jonathan Wakely wrote:
On 17 November 2013 15:40, Sylvestre Ledru wrote:
For "control reaches end of non-void function", I haven't activated by
default and I called the option -Wfalloff-nonvoid-function
Of course, that is just a proposal! :) Better names are welcome.
It was nearly called -Wmissing-return a decade ago, but got bundled
with -Wreturn-type, see
http://gcc.gnu.org/ml/gcc-patches/2002-02/msg02002.html
As discussed on this mailing list, I proposed a patch on the gcc-patches
mailing list.
http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00820.html

Any chance one of you could review it?

I like the change in principle, but it's not up to me, I can't approve
front-end patches.  I can comment on the docs and ChangeLog but I'm
not subscribed to gcc-patches so didn't get the mail. I'll send some
comments, could you please reply to your gcc-patches mail and include
my comments? Thanks.
Note that your opinion is still quite important in this space though.

My gut tells me for C++ this is a no-brainer. For C it's less clear, but I think we still want it. Ultimately I suspect we're going to catch more real bugs than false positives once we start looking at real code rather than the regression suite.

As long as folks writing code like Geoff K pointed out in the 2002 thread can turn the warning off, I think we'll be OK.

So Sylvestre, the big part of the work is doing a bootstrap and regression test and it looks like you're well into that. Hopefully you can wrap up soon.

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]