Hacker News new | ask | show | jobs
by adrusi 2590 days ago
There are two different questions: "do all paths lead to returning a value?" and "will the function return a value?"

Answering the second in the general case is equivalent to solving the halting problem. But answering the first question is much simpler. Static analyzers aren't using a heuristic approach to the second question, they're solving a completely different problem.

1 comments

Don't get me wrong, but if whole classes of errors, can be avoided by not choosing C++, why should I choose to use it?
Because you already know C++ and don't want or can't justify learning another language. That's a very valable reason.