I have a function like this:
bool MyFunction(dist)
{
if(dist < 1.2)
{
std::cout << "Passed test!" << std::endl;
return true;
}
else
{
std::cout << "Failed test!" << std::endl;
return false;
}
std::cout << std::endl;
}
gcc tells me "warning- control reaches end of non-void function". However, the conditional must catch all cases (the else catches everything 'else' (by definition)). So clearly all that will happen is the last endl will never be hit. Is that what it is trying to tell me?
Thanks,
Dave