title: Why "not all control paths return a value" is warning and not an error?
body: <p>I was trying to answer <a href="https://stackoverflow.com/questions/1734927/compare-characters-at-the-end-of-the-string-c">this</a> question. As suggested by the accepted answer, the problem with that code is that not all control paths are returning a value. I tried this code on the VC9 compiler and it gave me a warning about the same. My question is why is just a warning and not an error? Also, in case the path which doesn't return a value gets executed, what will be returned by the function (It has to return something) ? Is it just whatever is there on top of the stack or is the dreaded undefined behavior again?</p>