[RFC] GCC caret diagnostics
Chris Lattner
clattner@apple.com
Thu Mar 13 21:55:00 GMT 2008
On Mar 13, 2008, at 11:37 AM, Ian Lance Taylor wrote:
> As you know the optimizers can pull together information
> from all over the place. The actual warning can be issued for code
> which looks very different from anything the user actually wrote.
> Translating back to the problem in the user code can be complicated.
> I don't think gcc is going to be able to do that translation.
While this is absolutely true, think about what you're saying here.
Roughly categorized, there are two cases that happen:
1. The problem is relatively simple and doesn't require deep analysis
to identify and explain to the user.
2. The problem is subtle, requiring multiple levels of optimizer to
interact correctly to find the problem.
In case #1, you can have good location info and use cheap techniques
for finding the problem. If you do this and tell the user, they are
likely to understand and fix the problem.
In case #2, even if you find an obscure (and real!) bug, without
*really* good location info, there is a very low likelihood that the
user will understand it. It's more likely that they will turn off the
warning or file a GCC bug.
-Chris
More information about the Gcc
mailing list