3 ms·
Or better yet, perhaps they should just do the sane thing instead of being a hostile pedantic smartass. Undefined shouldn't mean "whatever", it should be an op
by userbinator 2y ago
Or better yet, perhaps they should just do the sane thing instead of being a hostile pedantic smartass.
Undefined shouldn't mean "whatever", it should be an opportunity to consider what makes the most sense.
- amelius 2y agoBut then you have to write a standard.
- lmm 2y agoYou actually don't. Plenty of languages and compilers manage to be less programmer-hostile without a written standard. Unfortunately GCC/Clang have prioritised getting higher numbers on benchmarks.
- favorited 2y ago> Unfortunately GCC/Clang have prioritised getting higher numbers on benchmarks. Because that's what people actually want. There's no untapped market for a C compiler that doesn't aggressively optimize. The closest you'll get is projects selectively disabling certain optimizations, like how the Linux kernel builds with `-fno-strict-aliasing`.
- lmm 2y ago> There's no untapped market for a C compiler that doesn't aggressively optimize. There probably isn't now, because people who want sanity have moved on from C.I do think that years ago a different path was possible. > The closest you'll get is projects selectively disabling certain optimizations, like how the Linux kernel builds with `-fno-strict-aliasing`. Linux also does `-fno-delete-null-pointer-checks` and probably others. I don't think they have a principled way of deciding, rather whenever an aggressive optimization causes a terrible bug they disable that particular one and leave the rest on.
- userbinator 2y agoNo, only a small amount of people care about compiler benchmarks... which are not representative of general-purpose code anyway since they seem more interested in testing vectorisation and other dubious features that are only important for a tiny subset of everything a compiler gets used for. That said, ICC and MSVC can achieve similar or better results without going insane with UB, so it's clearly not as strictly necessary as the lame pedants want you to believe.
- circuit10 2y agoThat could cause a noticeable performance drop