[PATCH] get rid of windows C4146 warning in MathExtras.h

Aaron Ballman aaron at aaronballman.com
Wed Feb 27 05:34:42 PST 2013


On Wed, Feb 27, 2013 at 8:08 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Peng,
>
>
>> See detals at http://msdn.microsoft.com/en-us/library/4kh09110.aspx
>
>
> I see, thanks.  Can't you just suppress the warning instead?  The current
> code
> is correct, and your proposed fix makes the code too hard to read IMO.

I'm on the fence.  Suppressing warnings makes the code just as ugly
(we don't want to apply the suppression to the entire file, so it
means we have to add it three places), but this code is certainly
harder to understand than the original code.

I wonder if we could leave the original code in as comments explaining
Peng's code?  I usually abhor that even more than ugly code since it
can get out of whack, but I don't see this code being modified that
often either.

~Aaron



More information about the llvm-commits mailing list