<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 19, 2017 at 7:51 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><span class="gmail-"><div>On Dec 19, 2017, at 6:02 PM, Shoaib Meenai <<a href="mailto:smeenai@fb.com" target="_blank">smeenai@fb.com</a>> wrote:</div><br class="gmail-m_3234519991931402790Apple-interchange-newline"></span><div><div class="gmail-m_3234519991931402790WordSection1" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span class="gmail-"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></span><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">-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" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">https://reviews.llvm.org/<wbr>D39149</a><span class="gmail-m_3234519991931402790Apple-converted-space"> </span>for my initial attempt to work around the warning, and then<span class="gmail-m_3234519991931402790Apple-converted-space"> </span><a href="https://reviews.llvm.org/D41368" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">https://reviews.llvm.org/<wbr>D41368</a>, which just silences the warning where it's problematic.<u></u><u></u></span></div><span class="gmail-"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Unfortunately, this appears to be a pretty widespread problem. For example, Petr Hosek reported in<span class="gmail-m_3234519991931402790Apple-converted-space"> </span><a href="https://reviews.llvm.org/D39462" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">https://reviews.llvm.org/<wbr>D39462</a><span class="gmail-m_3234519991931402790Apple-converted-space"> </span>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<span class="gmail-m_3234519991931402790Apple-converted-space"> </span><a href="https://reviews.llvm.org/D39462" style="color:rgb(149,79,114);text-decoration:underline" 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></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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?</span></div></span></div></div></blockquote><div><br></div></div>If there's significant community concern about this, and to me that standard has been met, then I think the only reasonable solution is to take it out of -Wall until we feel more confident in it.<span class="gmail-HOEnZb"><font color="#888888"></font></span></div><div style="word-wrap:break-word"><br></div></blockquote><div><br></div><div>I concur.</div><div><br></div><div>Yesterday I received the following bug report against libc++:</div><div>   Bug 35698 - include/istream causes test failures on x86 due to -Werror,-Wtautological-constant-compare</div></div>   <a href="https://bugs.llvm.org/show_bug.cgi?id=35698">https://bugs.llvm.org/show_bug.cgi?id=35698</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Marshall</div><div class="gmail_extra"><br></div></div>