3 ms·
But the problem is that everyone really wants their builds to run with -O3 (which should, and is, -Ogoforit). It's really common for bugs to only appear when c
by wonko1 10y ago
But the problem is that everyone really wants their builds to run with -O3 (which should, and is, -Ogoforit).
It's really common for bugs to only appear when compiling with optimization.
Reasonably, when those bugs appear, people go fix them.
My guess is in LLVM these optimization are turned off for debug builds. But who wants to be running debug builds all the time?
- lmm 10y agoA lot of the time non-optimized builds are fine. Unfortunately C (or rather C implementations) advertise the opportunity to make your code "as fast as possible" assuming you haven't made any mistakes, and too many programmers think "of course I want my code to run as fast as possible, and of course I don't make mistakes".
- wonko1 10y agoI think it's partly that if you're not looking for speed improvements then C, as a language, begins to look less attractive. There are certainly safer alternatives, but not faster ones. I'd probably agree though, in most cases users don't need the fastest builds (most OS tools). It would be interesting actually to be able to enabled optimized versions of functions as a runtime flag. But I've never seen that done.
- hermitdev 10y agoThis is one of the reasons I insist on my C/C++ code compiling with "-Wall -Wextra -Werror" and a few other switches.
- nwmcsween 10y agoNo, there needs to be a article on -Wall -Wextra and -Werror being harmful, these are metaflags that: 1. Vary between compiler versions. 2. Vary between compiler implementations. 3. Often contain somewhat useless warnings (Wparentheses) that can change with changes in 1. or 2.