23 ms·
Having been a blamer of tools, I would rather say "A good workman who blames his tools fixes the tools or gets better tools" The statement This is, simply put,
by wglb 17y ago
Having been a blamer of tools, I would rather say "A good workman who blames his tools fixes the tools or gets better tools"
The statement This is, simply put, appalling advice. regarding the advice to try lowering the optimization level to see if the heisenberg goes away. The headline here uses the word "blame" but the referenced article has a headline of When you see a heisenbug in C, suspect your compiler’s optimizer.
Having written a couple of compilers and used many, I agree with the advice to "suspect" the optimization level. Try the lower level, but keep in mind that it could either be a lucky rearrangement of your particular code or a bug in the optimizer.
The -O3 level is widely held to be risky. To me, this means that there is risk of bad code generated, not risk of the resulting program being too fast.
I think the realistic estimate of the probability of errors in gcc is either 1.0 or approaches 1.0, and with -O3 it is not lower.
Yes, lots of people compile lots of programs with gcc and g++, but every shop I have seen has a set of coding standards that suggest or demand avoidance of certain features.
There is a test of a program or specification that gives you a choice between 1) Obviously no deficiencies or 2) No obvious deficiencies. Doesn't seem to me that gcc/g++ (or any other competing compiler) fits either of these criteria.
- CoreDumpling 17y agoSome of us don't quite have the luxury of fixing our tools (MSVC++ I'm looking at you). Considering the sheer complexity of languages like C++, it's unsurprising that there will be problems here. I've been a blamer of tools as well, but I've convinced myself that it's ultimately wasted effort to do so. Better to simply come to terms with the fact that there do exist bad tools, that they ought to be avoided when reasonable, and that they should be used with care when necessary.
- wglb 17y agoYes, tools as big as C compilers and C++ compilers are pretty hard to fix, but then there was an effort to "fix" this by starting LLVM and clang, etc. One might argue that pg is "fixing" lisp by starting arc, and that Rick Hickey is fixing Java (and some say Lisp) by starting Clojure. In my case, i "fixed" fortran by getting into compilers and learning other languages. So really "fixed" in this note I guess translates as "moved away from".