This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27456] Compiler allows function not returning value to be used
- From: "aftli at optonline dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2006 16:50:30 -0000
- Subject: [Bug c++/27456] Compiler allows function not returning value to be used
- References: <bug-27456-12642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from aftli at optonline dot net 2006-05-06 16:50 -------
Subject: Re: Compiler allows function not returning value to be
used
You're right, it does give a "warning" if you use -Wall. But on the
default warning level, the program has two major errors, which should
not be considered warnings. It has a non-void function, which is used,
not returning a value, and a void function (main()) returning a value.
Every other compiler I've used spits out error messages for these
problems. This is a big problem, not a "INVALID" concern.
Also, did you notice the void function
rguenth at gcc dot gnu dot org wrote:
> ------- Comment #1 from rguenth at gcc dot gnu dot org 2006-05-06 14:57 -------
> It says "warning: control reaches end of non-void function", also the code is
> not invalid, but undefined, thus you get a segfault.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27456