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>
The warning was not indicating a bug, but it's ok to fix it in any case, I applied a patch in r111148. Thanks! -Chris On Aug 16, 2010, at 4:03 AM, nobled wrote:> 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; > } > <fix-32bit-warning.patch>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Maybe Matching Threads
- [LLVMdev] arm64 / iOS support
- [LLVMdev] Win32 COFF Support patch 5 (the final patch in the saga!)
- [LLVMdev] Win32 COFF Support patch 5 (the final patch in the saga!)
- [LLVMdev] MC ELFObjectWriter backend refactoring
- [LLVMdev] Win32 COFF Support patch 5 (the final patch in the saga!)