<div dir="ltr">+Roman, the patch author<div><br></div><div>+1 for disabling this, most of these have been false positives.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 19, 2017 at 3:02 PM, Shoaib Meenai via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_574265365025345475WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi all (CC some people who have been involved in this discussion already and Hans for clang 6 release discussion),<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Wtautological-constant-<wbr>compare was introduced in r315614 to diagnose tautological comparisons against a type's maximum and minimum bounds. However, this warning can fire spuriously when a type's size is platform-dependent.
 For example, libc++ has some generic code for which the warning fires on platforms where int and long have the same size; see
<a href="https://reviews.llvm.org/D39149" target="_blank">https://reviews.llvm.org/<wbr>D39149</a> for my initial attempt to work around the warning, and then
<a href="https://reviews.llvm.org/D41368" target="_blank">https://reviews.llvm.org/<wbr>D41368</a>, which just silences the warning where it's problematic.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Unfortunately, this appears to be a pretty widespread problem. For example, Petr Hosek reported in
<a href="https://reviews.llvm.org/D39462" target="_blank">https://reviews.llvm.org/<wbr>D39462</a> that he had to globally disable the warning when they rolled out a newer clang. Roman attempted to address this problem by having the warning take type size differences into account
 in <a href="https://reviews.llvm.org/D39462" target="_blank">https://reviews.llvm.org/<wbr>D39462</a>, but that's tricky to implement and hit some implementation roadblocks.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I think shipping the warning in its current state in clang 6 is going to be problematic, because there are going to be many instances of generic code running into spurious warnings. At the very least, I think
 the warning as-is shouldn't be part of -Wall. What are other people's thoughts on this issue?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Shoaib<u></u><u></u></span></p>
</div>
</div>

<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>