Re:Catch-23: The New C Standard Sets the World on Fire
by AlotOfReading on Sunday April 02, 2023 @01:48PM
(#35413167)
To provide some more context/motivation for why you might care, I write safety-critical code. I'm often advising people what they need to do for certification, etc. If all you need to do is ensure that you never execute undefined operations and knock out the list of specified UB, that's totally, 100% manageable. Throw some sanitizers on, provide realistic input, and test the hell out of it. Normal stuff.
If the reality is that any UB can invalidate the entire program (as is the interpretation taken by other standards re: C), then that's not remotely sufficient. You have to ensure the complete absence of UB.
Re:Catch-23: The New C Standard Sets the World on Fire
by still_grokking on Sunday April 02, 2023 @03:53PM
(#35414428)
That's like saying: "I don't care what the standard says!"
Sure, this is perfectly fine.
Only that you're not writing any C/C++ than, but something in the "gcc 12 language with some switches", or maybe the "LLVM 15 language with some switches", or something like that.
Re:Catch-23: The New C Standard Sets the World on Fire
by AnimalMuppet on Sunday April 02, 2023 @06:02PM
(#35415736)
Well, if Visual Studio (or whatever Microsoft calls their compiler these days), and all known versions of gcc, and all known versions of LLVM all do something sane, then I'm not sure I care all that much about the theoretical possibility that some compiler someday might do something insane.
But those of us who are actually writing programs mostly care about "in practical terms", and in practical terms, this doesn't happen, so we don't care. We've got enough trouble worrying about what does happen; we don't have time and energy to worry about what doesn't and won't happen.