[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:53:17 PDT 2015



From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: Tuesday, March 24, 2015 10:46 AM
To: Kaylor, Andrew
Cc: Aaron Ballman; llvm-commits at cs.uiuc.edu
Subject: Re: [llvm] r233067 - Silencing some MSVC warnings "C4805: '^' : unsafe mix of type 'bool' and type 'unsigned int' in operation"; NFC.



On Tue, Mar 24, 2015 at 10:44 AM, Kaylor, Andrew <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>> wrote:
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.

His this come up much/at all?

I’m not aware of it coming up at all.


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


More information about the llvm-commits mailing list