On Feb 28, 2012, at 10:29 PM, David Blaikie <[email protected]> wrote:

> Should we just change the way the CFG is built to include edges for
> default labels on covered switches all the time? That would fix the
> same bug (I'm on the fence about whether it is a bug, myself) in
> Clang's -Wunreachable-code.

Hi David,

Besides the technical solution I proposed in my other email, I thought I'd add 
one more thing.

>From a design perspective, I don't believe what you propose would even be the 
>right balance.  All the other analyses in clang, the dataflow based warnings, 
>the static analyzer, etc., are fine with the current CFG with respect to how 
>'default' labels are handled.  Should we really weaken the CFG, thus degrading 
>the precision of all of these analyses, just to make this one warning easier 
>to implement?

Even if I didn't have an idea for a potentially general solution to allow the 
CFG to better service everyone (and I'm not saying it is perfect; we'd have to 
evaluate it if we are interested), this seems like the wrong tradeoff to me.  
If this was a pervasive problem for clients of the CFG, then I think it would 
be worth considering, but that's why I proposed the "ghost edges" idea as a 
possible way to satisfy multiple clients, including -Wunreachable-code.

Ted
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to