4 ms·
You mean like approximately zero percent of non-trivial C or C++ programs in actual existence?
by patrec 10y ago
You mean like approximately zero percent of non-trivial C or C++ programs in actual existence?
- adrianN 10y agoYou could of course switch to Ada.
- masklinn 10y agoExcept Ada has UB (they used to call them bounded errors, but the semantics are basically identical), and reading the musings of ADAists[0] > I would say, having looked at hundreds of thousands of lines of Ada, that I have had a disappointingly frequent experience in finding the UNCHECKED_CONVERSION generic used in production Ada code. > I agree that this is often a mark of poor craftsmanship and unhesitatingly discourage its use, but it is there [0] https://www.cs.york.ac.uk/hise/safety-critical-archive/2011/0216.html https://www.cs.york.ac.uk/hise/safety-critical-archive/2011/...
- adrianN 10y agoIf finding potential UB in Ada programs is as simple as grepping for unchecked_conversion, then that's a big step forward compared to C, don't you think?
- masklinn 10y ago1. your claim was essentially that ADA = no UB, so that's hardly relevant 2. that's not Ada's only UB, the 2005 spec has 35 or 36, which granted is an improvement over C's circa 200, but a far cry from being UB free
- adrianN 10y agoThe claim is that it's impossible to avoid UB in real world C, but not impossible in real world $SAFERLANGUAGE, with Ada as an example. Any language that allows you to poke around in memory (a feature you need for embedded systems) will contain unsafe constructs. The question is whether you can tell by looking whether a particular piece of code is safe or not.