Quote:Original post by osmanb
Quote:Original post by speciesUnknown
I've been programming on and off for 12 years and have seen a grand total of 4 genuine, verified bugs in interpreters / compilers. The other 1.2E97 errors were my fault.
You're lucky. I've seen dozens, and I've personally tracked down at least 10 (producing reliable test-cases for the vendors). The joys of console development.
I've also tracked down a few from vendors over the years. They are rare but they
do happen. The smaller the audience the more likely you are to find them, which is why console and embedded programmers complain so much about the low quality of the tools. Almost everything I've seen over the last five or eight years has been many orders of magnitude better than the older compilers. We used to just have the AT&T c++ specs to claim violations, but often those cries fell on deaf ears. Being able to point at an ISO standard has really helped every serious compiler out there.
Just beware.
Unless you have real proof that it is wrong, don't go blaming the compiler.
Remember that thousands or tens-of-thousands of people around the globe are using those tools. The odds of you discovering a major bug are extremely small. It is much more likely that it is a fault in your own code. If you are saying something like "The STL is broken" you are probably wrong. If it is something like "a particular combination of function pointers inside an anonymous union doesn't seem to work properly", then you may be on to something.
In the case of a crash, you should be prepared with output of an actual compiler crash or ICE along with source that they can use to reproduce it. Those are easy to spot.
Often people claim: "You have a bug that such-and-such didn't do what I expected". They are often immediately countered with short replies like: "See the language standard, section 6.x.y paragraph 4. The behavior you saw is correct." When you make a claim, you better be able to show exactly what the problem is, a short code sample that demonstrates it, and the exact place in the language standard that says it is wrong.
In the case of debug vs released/optimized code, it is often harder to prove a compiler error. You have to prove that your optimizations were incorrectly applied, and not the result of a correctly acting but misapplied optimizer. The most common non-bug I've seen is aggressive dead code removal -- if you aren't directly accessing a function the optimizer may (legitimately) see it as dead code and remove it. When you start getting fancy with the language, carefully watch the verbose compiler and linker outputs before claiming it is a bug.
It's okay to claim you found a bug. Just be prepared to prove it.