[llvm] r233067 - Silencing some MSVC warnings "C4805: '^' : unsafe mix of type 'bool' and type 'unsigned int' in operation"; NFC.

Kaylor, Andrew andrew.kaylor at intel.com
Tue Mar 24 10:44:37 PDT 2015


On Tue, Mar 24, 2015 at 9:23 AM, David Blaikie <dblaikie at gmail.com<mailto:dblaikie at gmail.com>> wrote:
> Looking at the docs (sparse as they are) on MSDN https://msdn.microsoft.com/en-us/library/1hy2y0bk%28v=vs.90%29.aspx perhaps this warning was intended for the comparison case & spilled over into assignment?
>
> In the comparison case it's still not going to explode on MSVC in new/interesting ways, by the sounds of it. It's just seems to be talking about "int == bool" comparison promoting the bool to an int, then comparing the ints, rather than the other way around, which perhaps the user intended.
>
> None of the first page of Google results for C4805 seem to indicate anything more sinister going on here.

So what about the “int == bool” case?  It may not explode, but it at least has the potential to do something different than was intended.  If we disable the warning globally, that case will be hidden as well.  MSVC considers this a level 1 warning, which is the main reason I’m reluctant to disable it.

-Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150324/b237ddef/attachment.html>


More information about the llvm-commits mailing list