[lld] r233088 - [Mips] Suppress "right shift by too large amount" warning
Aaron Ballman
aaron at aaronballman.com
Wed Mar 25 11:56:20 PDT 2015
On Wed, Mar 25, 2015 at 2:02 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Wed, Mar 25, 2015 at 10:55 AM, Simon Atanasyan <simon at atanasyan.com>
> wrote:
>>
>> On Wed, Mar 25, 2015 at 8:42 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> >
>> > On Wed, Mar 25, 2015 at 10:38 AM, Simon Atanasyan <simon at atanasyan.com>
>> > wrote:
>> >>
>> >> By the way, what do you suggest to silence the VC++ warning?
>> >
>> > Disabling the warning, this is a false positive because some
>> > instantiations
>> > of the template produce non-zero results out of this shift and the fact
>> > that
>> > some other instantiations always produce 0 is fine. Same goes for
>> > template-conditionally dead code, etc.
>>
>> In fact I am satisfied by the current code as well as by you
>> suggestion. The only problem - I do not have access to VC++ so cannot
>> surround the code by appropriate warning disabling pragmas and check
>> that they work.
>
>
> Nah, I'm suggesting a somewhat more aggressive patth forward: disable the
> warning entirely for the LLVM build. Andy Kaylor recently submitted a patch
> to disable a bunch of noisy MSVC warnings & I'd suggest we just add this one
> to the list.
I'm still somewhat opposed to that idea. This warning does find true
positives (though infrequently, I would imagine). We do a fair amount
of bit twiddling in our code base (including in ADT classes), and
turning off this warning because of one false-positive for which we've
found several ways to silence it seems extreme. This isn't a
particularly chatty diagnostic, and it's almost always going to point
out a code smell that we would want to look at further when it does
arise.
~Aaron
More information about the llvm-commits
mailing list