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]

Re: c++ bug in egcs-2.93.11 on alphaev56-dec-osf4.0d


> 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


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