Sorry, I should have checked the change to the patch. Here is a new patch that fixes it. I found a couple of more places with the same issue.<div><br></div><div>-Nathan<br><br><div class="gmail_quote">On Sat, Sep 25, 2010 at 7:53 AM, Ahmed Charles <span dir="ltr"><<a href="mailto:ahmedcharles@gmail.com">ahmedcharles@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Note: static_cast<bool> doesn't make the warning go away or did you check that? I just compiled a small test and it didn't work. The recommended solution is:<br>
<br>(expression) != 0<br><br><a href="http://msdn.microsoft.com/en-us/library/b6801kcy.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/b6801kcy.aspx</a><br>
<br>It even says: Casting the expression to type <span><span>bool</span></span> will not disable the warning, which is by design.<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Sep 23, 2010 at 9:18 AM, Nathan Jeffords <span dir="ltr"><<a href="mailto:blunted2night@gmail.com" target="_blank">blunted2night@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5"><div><div></div><div><br><br><div class="gmail_quote">On Thu, Sep 23, 2010 at 4:04 AM, Michael Spencer <span dir="ltr"><<a href="mailto:bigcheesegs@gmail.com" target="_blank">bigcheesegs@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Thu, Sep 23, 2010 at 2:40 AM, Nathan Jeffords<br>
<<a href="mailto:blunted2night@gmail.com" target="_blank">blunted2night@gmail.com</a>> wrote:<br>
> here are a couple of patches to address some warnings<br>
> in Microsoft compilers, and a build error in vs2010 in particular<br>
> vs2010-errors.patch:<br>
> In SelectionDAGISel,  std::pairs or pointers are being constructed using a 0<br>
> as an initializer causes an error inside the std::pair constructor. I think<br>
> changes to language in support of the nullptr keyword caused this break.<br>
<br>
</div>Yep, people keep doing this. I've been behind on the trunk for a bit,<br>
but I was surprised to see this come up again. This is the correct<br>
fix, but please make sure you stick within 80 cols.<br>
<div><br></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>> vs2010-warnings.patch:<br>
> This patch fixes a couple of annoying warnings that show up all over the<br>
> place because they are in headers. At least for Microsoft compilers,<br>
> conversion of a int to bool requires the compiler to convert non-zero to one<br>
> and so the compiler warns of the performance issue. My fix is to explicitly<br>
> perform the conversion so the compiler knows I'm aware and doesn't warn me.<br>
> I don't know the behavior of other compilers in this respect, so I don't<br>
> know if it should be committed. The other solution would be to change the<br>
> return type of the accessors function to return ints, though this could move<br>
> the warning elsewhere.<br>
> -Nathan<br>
<br>
</div>This fix looks like a case of 3am programming. I think using<br>
static_cast<bool> is clearer.<br>
<font color="#888888"><br>
- Michael Spencer<br>
</font></blockquote></div><div><br></div></div></div><div>here are updated versions</div><br><font color="#888888"><div>- Nathan</div><div><br></div>
</font><br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Ahmed Charles<br><a href="http://www.ahmedcharles.com" target="_blank">http://www.ahmedcharles.com</a><br>
</font></blockquote></div><br></div>