Defining the Undefinedness of C (2015) [pdf]
Here&#x27;s something I&#x27;d love to know about undefined behavior in C: is this something specific to C, or is it something that <i>any</i> similar language would have to contend with?<p>It seems like problems crop up when you combine a fairly low-level language with an emphasis on performance, a specification that explicitly calls out implementation-defined and undefined semantics, and very highly optimizing compilers.<p>None of the &quot;safer C&quot; languages seems to have gained much traction. Is that because the problem really is intractable, or just because maintaining a decent level of compatibility with C is too hard? The major selling point of a safer C is being able to reuse lots of existing C code, after all.<p>Note that other languages probably have the same pitfalls, just latent for now -- their specs are silent about undefined operations, or they don&#x27;t have specs at all, and their compilers don&#x27;t optimize as aggressively as GCC or Clang.