3 ms·
Detecting division by zero with 100% accuracy in a general C or C++ program without assistance is equivalent to the halting problem. Now I'm not saying that th
by planede 4y ago
Detecting division by zero with 100% accuracy in a general C or C++ program without assistance is equivalent to the halting problem.
Now I'm not saying that they solved the halting problem, as that is not possible. Rather that there is missing information on the linked page. Either:
1. The tool requires the an external machine-checkable proof that no division by zero happens.
2. Certain language constructs are disallowed. They probably just ban goto (this is fine), possibly also recursion, multiple return statements, loops without a hard bound of iteration, etc... .
Or both. Where can I find information about this?
- aeneasmackenzie 4y agoUsually these tools just bail out. This is fine for the domain. Any division where the divisor is not known nonzero is a bug even if it will never happen because you probably aren't sure it will never happen either.
- muldvarp 4y ago> Or both. Neither, the tool has false positives, i.e. it sometimes reports divions as a potential divion by zero even though it isn't one.