Why “not all control paths return a value” is warning and not an error?
Failing to return a value from a function that has a non-void return type results in undefined behaviour, but is not a semantic error. The reason for this, as far as I can determine, is largely historical. C originally didn’t have void and implicit int meant that most functions returned an int unless explicitly declared … Read more