[Bug c++/55189] enable -Wreturn-type by default
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Martin Liška changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #13 from Martin Liška --- Fixed on trunk, there will be no backport.
[Bug c++/55189] enable -Wreturn-type by default
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Eric Gallager changed: What|Removed |Added Status|NEW |ASSIGNED
[Bug c++/55189] enable -Wreturn-type by default
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Martin Liška changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org --- Comment #12 from Martin Liška --- I take it, I have fixed test-suite fallout. Hopefully this time the patch will land to trunk.
[Bug c++/55189] enable -Wreturn-type by default
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org, ||marxin at gcc dot gnu.org --- Comment #11 from Eric Gallager --- cc-ing Martin Liska because I think he fixed this recently
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 --- Comment #8 from Sylvestre Ledru sylvestre at debian dot org --- The patches to fix this bug are available here: https://github.com/sylvestre/gcc I am doing the legal FSF papers to be able to apply it.
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Comment #9 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Sylvestre Ledru from comment #8) The patches to fix this bug are available here: https://github.com/sylvestre/gcc I am doing the legal FSF papers to be able to apply it. Cool! Hopefully it goes quickly. After that, I would suggest that you submit the patch to gcc-patches and CC Jason Merrill and Dodji Seketeli, either of them should be able to approve this. I noticed that your patch does not update doc/invoke.texi to reflect the fact that -Wreturn-type is enabled by default instead of by -Wall (it would be great to automatically generate some parts of the manual from the options description). I also noticed that you did not include -Wmissing-return in your patch as discussed here: http://gcc.gnu.org/ml/gcc/2013-11/msg00288.html (Perhaps you did, and I am using github incorrectly?) I think you will get easier approval if you include it (or send two patches in the same email) and point out to the previous discussion (in particular Dodji, Joseph and Jason's approval of this idea).
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 --- Comment #10 from Sylvestre Ledru sylvestre at debian dot org --- (In reply to Manuel López-Ibáñez from comment #9) Cool! Hopefully it goes quickly. After that, I would suggest that you submit the patch to gcc-patches and CC Jason Merrill and Dodji Seketeli, either of them should be able to approve this. Sure. Thanks for the suggestion. I noticed that your patch does not update doc/invoke.texi to reflect the fact that -Wreturn-type is enabled by default instead of by -Wall (it would be great to automatically generate some parts of the manual from the options description). I will have a look! I also noticed that you did not include -Wmissing-return in your patch as discussed here: http://gcc.gnu.org/ml/gcc/2013-11/msg00288.html (Perhaps you did, and I am using github incorrectly?) I did... removed it :) I've followed Jason suggestion here: http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01033.html The problem that we were trying to address with -Wmissing-return has been fixed (AFAIK) by the commit description in comment #7 I think you will get easier approval if you include it (or send two patches in the same email) and point out to the previous discussion (in particular Dodji, Joseph and Jason's approval of this idea). Sure. Thanks for the advice.
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 --- Comment #7 from Jason Merrill jason at gcc dot gnu.org --- Author: jason Date: Thu Jan 23 18:54:08 2014 New Revision: 207001 URL: http://gcc.gnu.org/viewcvs?rev=207001root=gccview=rev Log: PR c++/55189 * cp-tree.h (struct language_function): Add infinite_loop and infinite_loops. (current_function_infinite_loop): New. * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop) (break_maybe_infinite_loop): New. (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt) (finish_do_stmt, finish_for_cond, finish_for_stmt) (begin_range_for_stmt): Use them. * decl.c (finish_function): Don't warn about missing return if current_function_infinite_loop. * pt.c (instantiate_decl): Copy current_function_infinite_loop. * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop. Added: trunk/gcc/testsuite/g++.dg/warn/Wreturn-type-9.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/cp/semantics.c
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Sylvestre Ledru sylvestre at debian dot org changed: What|Removed |Added CC||sylvestre at debian dot org --- Comment #6 from Sylvestre Ledru sylvestre at debian dot org --- Patch proposed here: http://gcc.gnu.org/ml/gcc-patches/2013-12/msg01781.html
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot |gnu.org |com --- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com 2012-11-04 14:08:44 UTC --- Let's do this then.
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added Status|ASSIGNED|NEW AssignedTo|paolo.carlini at oracle dot |unassigned at gcc dot |com |gnu.org --- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com 2012-11-04 15:26:09 UTC --- Sorry, not me, not now: hundreds of testcases need fixing.
[Bug c++/55189] enable -Wreturn-type by default
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55189 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIRMED |NEW Last reconfirmed||2012-11-03 Summary|g++ compiler does not |enable -Wreturn-type by |report missing return on|default |function with return type | Ever Confirmed|0 |1 --- Comment #3 from Jonathan Wakely redi at gcc dot gnu.org 2012-11-03 13:03:14 UTC --- (In reply to comment #2) If this is not bug why shouldn't we make int n; n =; printf(%d,n); to be legal code, compiler should simply assign whatever it wants. Right ? No, because that's not even legal syntax, so that's a completely different case. -Wreturn-type should be set by default. OK, so let's change the report to say that then. In general though, please don't report bugs claiming there are no warnings if you haven't even tried -Wall, there's a notice when you report a bug asking you to check that. Reduced example: struct A { int i; }; A f() { A a = { 0 }; // missing return } int main() { A a = f(); return a.i; }