Al************@gmail.com wrote:
In my code, I have a function which has a return value in the
declaration:
bool myFunction( int a) {
// my implmentation
}
how come the code still compile even if I don't have a return value
(neither true/false). How can I enforce that ? i am using gcc on
linux.
Ask in gnu.gcc.help (or gnu.g++.help). Often, if your compiler gives
you a warning, you can try "treat warnings as errors", and jack the
warning level all the way up.
Generally speaking, falling off the end of a function that is declared
as returning a value has _undefined_ behaviour, and no diagnostic is
required.
V
--
Please remove capital As from my address when replying by mail