On Tue, Aug 5, 2014 at 4:24 PM, Chandler Carruth <[email protected]> wrote:
> > On Tue, Aug 5, 2014 at 4:22 PM, Reid Kleckner <[email protected]> wrote: > >> IMO there is a big difference. All compilers have always returned true >> for unsigned >= 0, but other compilers may return true for &reference == >> nullptr. >> >> So, we can ignore the unsigned >= 0 warning so long as we are reasonably >> confident in past test coverage. >> >> However, with the &reference == nullptr behavior change, we don't have >> that confidence. Therefore it is more severe. >> > > FWIW, I think this might be a good reason to default the warning to on, > but it still seems like a somewhat tenuous argument for > '-Wno-tautological-compare' to leave this warning enabled... > The argument is: 1. Wtautological-compare used to warn on relatively harmless things. This warning has been around in older clang releases. 2. People disable it for some of their code. 3. clang later adds an optimization to remove null-comparisons of addresses of references. This is standards-conforming, but it might break some existing code. As mitigation, it adds Wtautological-undefined-compare (at least that's what I thought the motivation was). This is new in 3.5. 4. But due to 2, people might not see it and their code breaks needlessly with 3.5. If the warning was just called (say) Wnull-reference and if it was in its own warning group, this wouldn't happen.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
