[LLVMdev] Visual Studio 2010 build warning & errors

Nathan Jeffords blunted2night at gmail.com
Wed Sep 22 23:40:04 PDT 2010


here are a couple of patches to address some warnings
in Microsoft compilers, and a build error in vs2010 in particular

vs2010-errors.patch:
In SelectionDAGISel,  std::pairs or pointers are being constructed using a 0
as an initializer causes an error inside the std::pair constructor. I think
changes to language in support of the nullptr keyword caused this break.

vs2010-warnings.patch:
This patch fixes a couple of annoying warnings that show up all over the
place because they are in headers. At least for Microsoft compilers,
conversion of a int to bool requires the compiler to convert non-zero to one
and so the compiler warns of the performance issue. My fix is to explicitly
perform the conversion so the compiler knows I'm aware and doesn't warn me.
I don't know the behavior of other compilers in this respect, so I don't
know if it should be committed. The other solution would be to change the
return type of the accessors function to return ints, though this could move
the warning elsewhere.

-Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100922/d332b3f6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vs2010-errors.patch
Type: application/octet-stream
Size: 1770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100922/d332b3f6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vs2010-warnings.patch
Type: application/octet-stream
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100922/d332b3f6/attachment-0001.obj>


More information about the llvm-dev mailing list