2 ms·
> C/C++ being non-opinionated is the main source of the security vulnerabilities This. "Undefined behavior" is such a terrible way of thinking. As is the "we c
by pjc50 2y ago
> C/C++ being non-opinionated is the main source of the security vulnerabilities
This. "Undefined behavior" is such a terrible way of thinking. As is the "we can assume in the optimizer that UB does not happen and then eliminate code on that basis", which allows the compiler to introduce bugs that only appear at certain -O levels.
It took decades to get them to define arithmetic as twos-complement.
- aw1621107 2y ago> It took decades to get them to define arithmetic as twos-complement. I'm not sure this is right? IIRC C++20/C23 require two's complement representation for signed integers but generally leave other behaviors (including signed overflow) the same. [0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p09...