News for hackers. Stuff that matters.
Re:C for All by sedachv on Friday March 23, 2018 @06:06PM (#16662997)
> I don't get this "undefined behavior" cliche.

The problem is that you can do everything in portable C that you can do with undefined behavior in C, and often in a more straightforward fashion.[1] The compiler won't tell you that you are doing it wrong; there are many examples, tutorials, and books that encourage you to do the wrong thing. The undefined behavior will work until you switch to a different system. Why allow the wrong thing to continue to happen?

[1] A very good example of this is endianness:

https://news.ycombinator.com/item?id=16189110

https://commandcenter.blogspot.se/2012/04/byte-order-fallacy...

Re:C for All by fjsolwmv on Saturday March 24, 2018 @01:26AM (#16665033)
You are conflating undefined with implementation defined. If you use undefined behavior the compiler might simply delete your code since it's not defined.
Re:C for All by sedachv on Saturday March 24, 2018 @02:22AM (#16665168)
You and a lot of people in this discussion seem confused the other way. The amount of things in C that are implementation-defined is relatively small and most has to do with character encodings and byte size (storage unit). The kind of behavior people are pointing to is definitely labeled as undefined, and there is a lot of it. Take a look at Harbison and Steele for example.