3 ms·
Target a virtual architecture (LLVM IR). Run the original code in an emulator for the target system (QEMU); give warnings where the two differ, with a switch fo
by analognoise 11y ago
Target a virtual architecture (LLVM IR). Run the original code in an emulator for the target system (QEMU); give warnings where the two differ, with a switch for the virtual architecture to mimic the behavior of whatever architecture you need.
You get friendly C, a new way to think about warnings, and your old code can still be compatible with the new virtual architecture.
Next up, world hunger.
- webkike 11y agoThis solution relies on some undecidable problems as being decidable
- analognoise 11y agoHow so? I don't see the connection to undeciability.
- webkike 11y agoIf you have undefined behaviour after an infinite loop that breaks on some condition, then that undefined behaviour will not necessarily have been triggered. Thus, no warning.
- tamana 11y agoRegehr himself "disproved" Fermat's Last Theorem by abusing a non-terminating loop and over-aggressive compilers. http://blog.regehr.org/archives/140 http://blog.regehr.org/archives/140
- webkike 11y agoYes, this I a great example of the consequences of undecidability. Was taught to me in my algorithms and proofs class
- def- 11y agoYou can't simply run code for all possible inputs.
- analognoise 11y agoNo, but you can certainly exercise it well. It might be a degree of confidence measure. Combined with property verification (so, formal verification), you'd get a damn good idea they'd be close.