News for hackers. Stuff that matters.
Re:Undefined behavior in C is a reading error by rectang on Thursday May 20, 2021 @11:18PM (#27230106)
I want default behavior which does not surprise me. I have come to understand that this probably means I want a different language, because the C spec essentially requires compiler authors to make optimizations which introduce surprising semantics in order to compete on performance with other languages.

It would be fine if I could opt into new semantics — something like Rust's "editions" would resolve my objections about these compiler optimizations. But that doesn't seem to be on offer in the C ecosystem.

Re:Undefined behavior in C is a reading error by pjmlp on Friday May 21, 2021 @04:09AM (#27231609)
Only moving away to other languages will do it.

C culture and to certain extent Objective-C and C++ ones are tainted by microptimizaitons while typing, where the compilers are the worst examples.

Unfortunely UNIX and C go together, so those that want to keep UNIX like platforms around bettter fix C somehow.

Re:Undefined behavior in C is a reading error by rectang on Friday May 21, 2021 @01:20PM (#27236989)
That sucks. I can imagine next generation operating systems improving on Unix technically (standing on the shoulders of giants, yo), but establishing standards a la POSIX will be extremely difficult. It's hard to fight against the interest of platform vendors to lock their users in.
Re:Undefined behavior in C is a reading error by pjmlp on Friday May 21, 2021 @01:50PM (#27237438)
Microsoft fought for several years against C, trying to migrate everyone to C++ as the future of Windows systems programming.

Yet Azure Sphere, despite its security message, uses C only SDK.

Meanwhile Visual Studio now supports C11 and C17.

Market pressure, their customers weren't willing to buy into it, and the new Microsoft also wants all those POSIX FOSS packages written in C running on Windows.

Re:Undefined behavior in C is a reading error by Gibbon1 on Friday May 21, 2021 @04:44AM (#27231790)
I think that's unfair. The taint is 100% on the C++ side of things.

Hopefully the newer compiled languages will kill C++.

Re:Undefined behavior in C is a reading error by pjmlp on Friday May 21, 2021 @06:19AM (#27232259)
Nope, the tait lies 100% on the copy-paste compatibilty with a C subset.
Re:Undefined behavior in C is a reading error by Gibbon1 on Saturday May 22, 2021 @03:30AM (#27244370)
All you've done here is show that with C the concept of the l-user is still around.