This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++ bug in egcs-2.93.11 on alphaev56-dec-osf4.0d
- To: osken393 at mail dot student dot liu dot se
- Subject: Re: c++ bug in egcs-2.93.11 on alphaev56-dec-osf4.0d
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 18 Mar 1999 23:52:20 +0100
- CC: egcs-bugs at egcs dot cygnus dot com
- References: <Pine.GSO.3.96.990318192935.13811B-100000@lystra.lysator.liu.se>
> The following code is accepted by the compiler with strange results. Note
> that the member function is declared to return an int, but returns
> nothing.
It's not a bug in the compiler, it's a bug in the program. Running of
the end of the function without a return value is undefined behaviour.
With -Wall, the compiler says:
a.cc:1: warning: control reaches end of non-void function `Foo::bar()'
Regards,
Martin