News for hackers. Stuff that matters.
Re:Undefined behavior in C is a reading error by optymizer on Thursday May 20, 2021 @01:45PM (#27224469)
These are all issues a compiler could insert checks for, saving you the time to do it manually, while trading performance for security or correctness.

C doesn't trade performance away, so if you'd like to pay the price of these checks, it's on you, the programmer to add them in. C programmers have to put in extra effort to make the executables safer and output correct results.

Other languages trade off performance for safety and/or correctness. The programmers using them have to put in extra effort to make the executables run as fast as they do in C.

Ultimately, programmers tend to make rational choices, and the stockholm syndrome mentioned above is really just C programmers dealing with the consequences of the trade-off they made by using C.

Re:Undefined behavior in C is a reading error by vyodaiken on Thursday May 20, 2021 @05:23PM (#27227471)
C is designed to allow programmers to insert or remove checks as performance tuning. Compiler UB "optimizations" that remove that ability from the programmer make the language unusable.
Re:Undefined behavior in C is a reading error by optymizer on Friday May 21, 2021 @02:09PM (#27237679)
Not knowing what is UB in C is equivalent to not knowing a core part of the C language. In that situation, yes, C would seem unusable for people who have superficial knowledge of it.
Re:Undefined behavior in C is a reading error by vyodaiken on Friday May 21, 2021 @06:03PM (#27240537)
Nobody knows UB rules. The WG14 discussions are full of confusion.
Re:Undefined behavior in C is a reading error by vyodaiken on Saturday May 22, 2021 @12:07PM (#27247844)
Send Linux Torvalds a note and tell him he has only superficial knowledge of C.