That doesn't mean of course C inventors were stupid. They did their best at the time, for use case then, but today C standard=unproductive
And the overflow being UB allows good implementations to trap & crash on overflow.
-
-
In, e.g., Ada, the standard requires compilers to trap overflow, if user wishes, much much better than ad-hoc, not always avail, not for>
-
Requiring trap is attractive but problematic. Precludes almost all algebraic transformations at compile time. Analogous to fenv for floats.
-
You don't always require trap. There's the equivalent of pragma in the standard that mandates trap. Makes sense for non hot-path. Tunable
-
A pragma comparable to STDC FENV_ACCESS would be nice here, IF compilers even implemented stuff like that...
-
Fact is, in Ada they did. At any rate, UB is hard to justify here IMHO, esp w/o UBsan. BTW Android sort-of doing trap with the new UB-runtim
-
Another thing I forgot about Power Tools analogy. *Very* easy to understand safety guide. C expert fail internalize C safe programming rules
-
I don't think this is accurate. Most unsafe C is a consequence of breaking dead simple safety rules trying to be clever...
-
...which is a lot like disabling safety mechanisms on tools for the sake of being "macho"/saving time/whatever.
- 8 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.