News for hackers. Stuff that matters.
Re:C for All by aw1621107 on Friday March 23, 2018 @04:17PM (#16662284)
> "undefined behavior" mainly limits portability

I had the impression that some things are UB because they can't specify a single behavior that would be efficient across all platforms C targets.

Re:C for All by fjsolwmv on Saturday March 24, 2018 @01:31AM (#16665041)
No that's implementation-defined. Undefined means code that is logically incorrect, but too expensive for the compiler/runtime to check and handle (reject) it. A simple example is array out of bounds access. It's too expensive to demand the compiler prevent it or guarantee to trigger some kind of signal at runtime. But if you are willing to pay the cost , you can use a language or compiler that is safer and promises to throw an exception or provides safe statically sizd arrays