This is the mail archive of the gcc-bugs@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]

[Bug c++/27456] Compiler allows function not returning value to be used



------- 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


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