<div dir="ltr">Started a thread on llvmdev to discuss the prinicples here.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 25, 2015 at 11:56 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Mar 25, 2015 at 2:02 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Mar 25, 2015 at 10:55 AM, Simon Atanasyan <<a href="mailto:simon@atanasyan.com">simon@atanasyan.com</a>><br>
> wrote:<br>
>><br>
>> On Wed, Mar 25, 2015 at 8:42 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>> ><br>
>> > On Wed, Mar 25, 2015 at 10:38 AM, Simon Atanasyan <<a href="mailto:simon@atanasyan.com">simon@atanasyan.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> By the way, what do you suggest to silence the VC++ warning?<br>
>> ><br>
>> > Disabling the warning, this is a false positive because some<br>
>> > instantiations<br>
>> > of the template produce non-zero results out of this shift and the fact<br>
>> > that<br>
>> > some other instantiations always produce 0 is fine. Same goes for<br>
>> > template-conditionally dead code, etc.<br>
>><br>
>> In fact I am satisfied by the current code as well as by you<br>
>> suggestion. The only problem - I do not have access to VC++ so cannot<br>
>> surround the code by appropriate warning disabling pragmas and check<br>
>> that they work.<br>
><br>
><br>
> Nah, I'm suggesting a somewhat more aggressive patth forward: disable the<br>
> warning entirely for the LLVM build. Andy Kaylor recently submitted a patch<br>
> to disable a bunch of noisy MSVC warnings & I'd suggest we just add this one<br>
> to the list.<br>
<br>
</div></div>I'm still somewhat opposed to that idea. This warning does find true<br>
positives (though infrequently, I would imagine). We do a fair amount<br>
of bit twiddling in our code base (including in ADT classes), and<br>
turning off this warning because of one false-positive for which we've<br>
found several ways to silence it seems extreme. This isn't a<br>
particularly chatty diagnostic, and it's almost always going to point<br>
out a code smell that we would want to look at further when it does<br>
arise.<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>