coder

  • 0 Posts
  • 47 Comments
Joined 1 year ago
cake
Cake day: June 23rd, 2023

help-circle









  • What are you talking about? Compilers can and do flag undefined behavior as errors. I recommend you read up on the documentation of any compiler.

    And I recommend you read Chris Latter’s essay on UB.

    https://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html

    Where he gives plenty of examples of UB resulting in the compiler optimizing away safety and introducing security vulnerabilities silently. In part 3 he discusses the efforts clang has made to improve on this.

    He then went on to make Swift and says this: “Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production.”

    and

    “UB is an inseperable part of C programming, […] this is a depressing and faintly terrifying thing. The tooling built around the C family of languages helps make the situation less bad, but it is still pretty bad. The only solution is to move to new programming languages that dont inherit the problem of C.”