[LLVMdev] [PATCH] fix "32-bit shift" warning in MSVC

nobled nobled at dreamwidth.org
Mon Aug 16 04:03:28 PDT 2010


This should fix this warning from Visual Studio 2010:
33>..\..\..\llvm-2.8svn-build\lib\MC\MachObjectWriter.cpp(772):
warning C4334: '<<' : result of 32-bit shift implicitly converted to
64 bits (was 64-bit shift intended?)


Index: lib/MC/MachObjectWriter.cpp
===================================================================
--- lib/MC/MachObjectWriter.cpp	(revision 111120)
+++ lib/MC/MachObjectWriter.cpp	(working copy)
@@ -769,7 +769,7 @@
       IsPCRel = 1;
       FixedValue = (FixupAddress - Layout.getSymbolAddress(SD_B) +
                     Target.getConstant());
-      FixedValue += 1 << Log2Size;
+      FixedValue += static_cast<uint64_t>(1) << Log2Size;
     } else {
       FixedValue = 0;
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-32bit-warning.patch
Type: text/x-patch
Size: 491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100816/27211168/attachment.bin>


More information about the llvm-dev mailing list