<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">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 class="im">On Thu, Sep 23, 2010 at 2:40 AM, Nathan Jeffords<br>
<<a href="mailto:blunted2night@gmail.com">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 class="im"><br></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">> 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>here are updated versions</div><br><div>- Nathan</div><div><br></div>