This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Enable -Wreturn-type by default ?
- From: Jason Merrill <jason at redhat dot com>
- To: Dodji Seketeli <dodji at seketeli dot org>, Sylvestre Ledru <sylvestre at debian dot org>
- Cc: gcc at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Thu, 14 Nov 2013 09:29:07 -0500
- Subject: Re: Enable -Wreturn-type by default ?
- Authentication-results: sourceware.org; auth=none
- References: <5283ABF2 dot 5010209 at debian dot org> <871u2jw776 dot fsf at seketeli dot org>
On 11/14/2013 06:31 AM, Dodji Seketeli wrote:
int foo() {
return;
}
I am wondering why this warning hasn't been activated by default in the
first place, for C++ at least?
Note that using g++ to compile the example above with -std=c++98 yields:
foo.c:2:2: error: return-statement with no value, in function returning âintâ [-fpermissive]
So what do we gain from not emitting that warning by default there?
If we already give an error, we don't want to give a redundant warning.
I'm confused about what you're asking here.
Jason