News for hackers. Stuff that matters.
Re:ISO C became unusable for operating systems development by ErikCorry on Friday January 21, 2022 @09:28AM (#30023907)
In theory the difference between undefined behaviour and implementation defined behaviour is that ID behaviour must be documented. In practice good luck finding that documentation for each CPU and compiler combination. In fact good luck just finding it for LLVM and x64.
Re:ISO C became unusable for operating systems development by palotasb on Friday January 21, 2022 @10:02AM (#30024406)
Undefined behavior entails "there are no restrictions on the behavior of the program", meaning anything can happen, including executing the opposite of the program text. Implementation defined behavior is saner in the sense that program behavior is still defined. Examples of the latter are the exact type of std::size_t or the number of bits in a byte: https://en.cppreference.com/w/cpp/language/ub
Re:ISO C became unusable for operating systems development by immibis on Friday January 21, 2022 @11:26AM (#30025781)
The linked reference page does not say that implementation-defined behaviour must be sensible, only that it must be defined. Contrast with unspecified behaviour where "Each unspecified behavior results in one of a set of valid results."

I expect that most instances of implementation-defined behaviour come with additional rules which state that the implementation has to define something sensible.

Re:ISO C became unusable for operating systems development by josephcsible on Friday January 21, 2022 @09:58AM (#30024344)
No, that's the difference between unspecified and implementation defined behavior.
Re:ISO C became unusable for operating systems development by astrobe_ on Friday January 21, 2022 @12:58PM (#30027289)
This unspecifed behavior is perhaps a bit lesser-known than UB, here is a (hopefully non-null ;-) pointer:

https://stackoverflow.com/questions/18420753/unspecified-und...

Re:ISO C became unusable for operating systems development by ErikCorry on Friday January 21, 2022 @01:41PM (#30028032)
If you want to be pedantic about it then I guess Clang and GCC don't implement the standards since they treat implementation defined as unspecified.