Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix numeric IntPtr behavioral changes analyzer findings #75557

Merged
merged 25 commits into from
Oct 5, 2022

Conversation

buyaa-n
Copy link
Member

@buyaa-n buyaa-n commented Sep 13, 2022

With #74022 we are adding an analyzer that detects behavioral changes in built operators of numeric IntPtr feature. Some built in operators added added with the feature behave differently than the old user defined operators. Some operators that used to throw in unchecked context while overflowing will not throw anymore unless wrapped within checked context, and some operators that not used to throw in checked context now would unless wrapped within unchecked context.

Normally we would merge the analyzer to the roslyn-analyzers repo first then update the dogfooding version and along with code fixes, but as the analyzer still not merged yet but it still planned to be merged into 7.0 raising this PR without the analyzer dogfood version updates

Warnings found:
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(143,35): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\GC.CoreCLR.cs(784,72): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(236,31): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(257,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(359,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(382,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(383,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(424,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(481,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(508,47): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(528,33): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs(406,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(375,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(366,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2330,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2333,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\StubHelpers.cs(385,39): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs(36,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs(36,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Volatile.cs(102,67): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(81,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(137,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs(688,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\tools\aot\ILCompiler.RyuJit\ILCompiler.RyuJit.csproj]
\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs(3859,61): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\tools\aot\ILCompiler.RyuJit\ILCompiler.RyuJit.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2330,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2333,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Volatile.cs(102,67): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Delegate.cs(309,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Delegate.cs(432,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(38,35): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(103,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(207,31): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(229,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(331,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(355,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(356,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(397,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\GC.NativeAot.cs(628,72): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(375,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(366,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolBoundHandle.cs(181,76): warning CA2020: Built in operator '(UInt32)UIntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Threading\Timer.Windows.cs(27,22): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(81,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(137,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.TypeLoader\src\Internal\Runtime\TypeLoader\GenericDictionaryCell.cs(1127,47): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.TypeLoader\src\System.Private.TypeLoader.csproj]
\src\libraries\System.IO.Pipes\src\System\IO\Pipes\AnonymousPipeClientStream.cs(37,64): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.IO.Pipes\src\System.IO.Pipes.csproj]
\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\ProcessManager.Win32.cs(381,46): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.Process\src\System.Diagnostics.Process.csproj]
\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\ProcessManager.Windows.cs(601,52): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.Process\src\System.Diagnostics.Process.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(237,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(266,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(297,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(326,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.IO.MemoryMappedFiles\src\System\IO\MemoryMappedFiles\MemoryMappedView.Windows.cs(63,33): warning CA2020: Built in operator '(UIntPtr)UInt64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.IO.MemoryMappedFiles\src\System.IO.MemoryMappedFiles.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(202,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(204,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(204,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(814,74): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(863,21): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(536,29): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(1147,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\BerConverter.cs(552,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\BerConverter.cs(556,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(568,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(572,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(585,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(589,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(954,38): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(1385,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(1388,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(581,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(585,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(598,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(602,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(693,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(696,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(762,39): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(766,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\DirectoryControl.cs(732,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\DirectoryControl.cs(735,27): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.Speech\src\Result\RecognizedPhrase.cs(295,95): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Result\RecognizedPhrase.cs(781,97): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\Synthesis\EngineSiteSapi.cs(39,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\StreamMarshaler.cs(42,51): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\StreamMarshaler.cs(55,50): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.ServiceProcess.ServiceController\src\System\ServiceProcess\ServiceController.cs(215,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.ServiceProcess.ServiceController\src\System.ServiceProcess.ServiceController.csproj]
\src\libraries\System.ServiceProcess.ServiceController\src\System\ServiceProcess\ServiceController.cs(782,40): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.ServiceProcess.ServiceController\src\System.ServiceProcess.ServiceController.csproj]
\src\libraries\System.Data.Odbc\src\Common\System\Data\Common\SafeNativeMethods.cs(13,32): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\Common\System\Data\Common\AdapterUtil.Odbc.cs(666,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(1749,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(1799,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2355,71): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2432,63): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2557,74): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2558,71): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(209,69): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ImageAttributes.cs(455,74): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ImageAttributes.cs(456,74): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\EncoderParameters.cs(67,51): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(856,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(931,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(933,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(935,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1047,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1053,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1054,47): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1055,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1089,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1096,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1147,53): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1134,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1135,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1175,30): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1240,30): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1244,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(64,38): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(71,46): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(89,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(94,36): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(170,62): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(493,42): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(288,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(296,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(303,42): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(316,46): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(402,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(441,50): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(1162,63): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Data.OleDb\src\System\Data\Common\AdapterUtil.cs(1264,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\System\Data\Common\AdapterUtil.cs(1271,24): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\SafeHandles.cs(82,69): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbConnectionInternal.cs(415,52): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2617,29): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2617,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(482,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(505,49): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(537,33): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1207,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1209,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1211,41): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1211,64): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1223,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1469,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1476,21): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1489,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1306,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1522,73): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1808,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1720,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1764,70): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1765,49): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2363,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2501,54): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]

How the warnings handled?

  • Wrapped within checked expression in case the overflowing seems needs to be experienced
    • When the IntPtr/UintPtr used as a pointer
    • When the explicit casting to long is used on purpose (IntPtr)(((long)pNative) - sizeof(uint))
  • Used nint/nuint alias in case the IntPtr/UintPtr seems not used as a pointer
  • in some rare cases suppressed the warning (could not use the alias because it is an public API)
  • in some rare case changed the IntPtr to real pointer (void*), this is desired when the IntPtr is used as real pointer, but changing the type like this require much more code change which I am not sure if we want to update

@ghost
Copy link

ghost commented Sep 13, 2022

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

With #74022 we are adding an analyzer that detects behavioral changes in built operators of numeric IntPtr feature. Some built in operators added added with the feature behave differently than the old user defined operators. Some operators that used to throw in unchecked context while overflowing will not throw anymore unless wrapped within checked context, and some operators that not used to throw in checked context now would unless wrapped within unchecked context.

Normally we would merge the analyzer to the roslyn-analyzers repo first then update the dogfooding version and along with code fixes, but as the analyzer still not merged yet but it still planned to be merged into 7.0 raising this PR without the analyzer dogfood version updates

Warnings found:
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(143,35): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\GC.CoreCLR.cs(784,72): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(236,31): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(257,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(359,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(382,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(383,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(424,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(481,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(508,47): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\MulticastDelegate.cs(528,33): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs(406,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(375,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(366,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2330,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2333,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\System.Private.CoreLib\src\System\StubHelpers.cs(385,39): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs(36,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs(36,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Volatile.cs(102,67): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(81,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(137,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj]
\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs(688,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\tools\aot\ILCompiler.RyuJit\ILCompiler.RyuJit.csproj]
\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs(3859,61): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\tools\aot\ILCompiler.RyuJit\ILCompiler.RyuJit.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2330,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs(2333,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Volatile.cs(102,67): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Delegate.cs(309,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Delegate.cs(432,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(38,35): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(103,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(207,31): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(229,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(331,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(355,43): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(356,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\MulticastDelegate.cs(397,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\GC.NativeAot.cs(628,72): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(375,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs(366,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolBoundHandle.cs(181,76): warning CA2020: Built in operator '(UInt32)UIntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.CoreLib\src\System\Threading\Timer.Windows.cs(27,22): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(81,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs(137,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj]
\src\coreclr\nativeaot\System.Private.TypeLoader\src\Internal\Runtime\TypeLoader\GenericDictionaryCell.cs(1127,47): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\coreclr\nativeaot\System.Private.TypeLoader\src\System.Private.TypeLoader.csproj]
\src\libraries\System.IO.Pipes\src\System\IO\Pipes\AnonymousPipeClientStream.cs(37,64): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.IO.Pipes\src\System.IO.Pipes.csproj]
\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\ProcessManager.Win32.cs(381,46): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.Process\src\System.Diagnostics.Process.csproj]
\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\ProcessManager.Windows.cs(601,52): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.Process\src\System.Diagnostics.Process.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(237,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(266,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(297,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.Net.NameResolution\src\System\Net\NameResolutionPal.Windows.cs(326,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Net.NameResolution\src\System.Net.NameResolution.csproj]
\src\libraries\System.IO.MemoryMappedFiles\src\System\IO\MemoryMappedFiles\MemoryMappedView.Windows.cs(63,33): warning CA2020: Built in operator '(UIntPtr)UInt64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.IO.MemoryMappedFiles\src\System.IO.MemoryMappedFiles.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(202,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(204,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.Registry\src\Microsoft\Win32\RegistryKey.Windows.cs(204,28): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(814,74): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(863,21): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(536,29): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft\Win32\SystemEvents.cs(1147,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\BerConverter.cs(552,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\BerConverter.cs(556,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(568,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(572,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(585,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs(589,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(954,38): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(1385,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(1388,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(581,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(585,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(598,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(602,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(693,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(696,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(762,39): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\ldap\LdapConnection.cs(766,35): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\DirectoryControl.cs(732,31): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.DirectoryServices.Protocols\src\System\DirectoryServices\Protocols\common\DirectoryControl.cs(735,27): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj]
\src\libraries\System.Speech\src\Result\RecognizedPhrase.cs(295,95): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Result\RecognizedPhrase.cs(781,97): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\Synthesis\EngineSiteSapi.cs(39,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\StreamMarshaler.cs(42,51): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.Speech\src\Internal\StreamMarshaler.cs(55,50): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Speech\src\System.Speech.csproj]
\src\libraries\System.ServiceProcess.ServiceController\src\System\ServiceProcess\ServiceController.cs(215,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.ServiceProcess.ServiceController\src\System.ServiceProcess.ServiceController.csproj]
\src\libraries\System.ServiceProcess.ServiceController\src\System\ServiceProcess\ServiceController.cs(782,40): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.ServiceProcess.ServiceController\src\System.ServiceProcess.ServiceController.csproj]
\src\libraries\System.Data.Odbc\src\Common\System\Data\Common\SafeNativeMethods.cs(13,32): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\Common\System\Data\Common\AdapterUtil.Odbc.cs(666,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(1749,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(1799,39): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2355,71): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2432,63): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2557,74): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Data.Odbc\src\System\Data\Odbc\OdbcDataReader.cs(2558,71): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.Odbc\src\System.Data.Odbc.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(209,69): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ImageAttributes.cs(455,74): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ImageAttributes.cs(456,74): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\EncoderParameters.cs(67,51): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(856,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(931,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(933,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(935,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1047,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1053,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1054,47): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1055,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1089,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1096,48): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1147,53): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1134,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1135,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1175,30): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1240,30): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Printing\PrinterSettings.cs(1244,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(64,38): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(71,46): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(89,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Drawing.Common\src\System\Drawing\Imaging\ColorPalette.cs(94,36): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Drawing.Common\src\System.Drawing.Common.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(170,62): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(493,42): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(288,44): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(296,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(303,42): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(316,46): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(402,43): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(441,50): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\SharedPerformanceCounter.cs(1162,63): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Diagnostics.PerformanceCounter\src\System.Diagnostics.PerformanceCounter.csproj]
\src\libraries\System.Data.OleDb\src\System\Data\Common\AdapterUtil.cs(1264,20): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\System\Data\Common\AdapterUtil.cs(1271,24): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\SafeHandles.cs(82,69): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbConnectionInternal.cs(415,52): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2617,29): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2617,44): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(482,25): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(505,49): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(537,33): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1207,26): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1209,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1211,41): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1211,64): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1223,32): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1469,37): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1476,21): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1489,36): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1306,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1522,73): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1808,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1720,30): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1764,70): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(1765,49): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2363,55): warning CA2020: Built in operator '(IntPtr)Int64' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]
\src\libraries\System.Data.OleDb\src\OleDbDataReader.cs(2501,54): warning CA2020: Built in operator '(Int32)IntPtr' now may not throw when overflowing in unchecked context. Wrap the expression with 'checked' statement to restore old behavior. \src\libraries\System.Data.OleDb\src\System.Data.OleDb.csproj]

How the warnings handled?

  • Wrapped within checked expression in case the overflowing seems needs to be experienced
    • When the IntPtr/UintPtr used as a pointer
    • When the explicit casting to long is used on purpose (IntPtr)(((long)pNative) - sizeof(uint))
  • Used nint/nuint alias in case the IntPtr/UintPtr seems not used as a pointer
  • in some rare cases suppressed the warning (could not use the alias because it is an public API)
  • in some rare case changed the IntPtr to real pointer (void*), this is desired when the IntPtr is used as real pointer, but changing the type like this require much more code change which I am not sure if we want to update
Author: buyaa-n
Assignees: -
Labels:

area-Meta

Milestone: -

@tannergooding
Copy link
Member

CC. @jkotas, you were particularly interested in the how some of this was changed.

@@ -1762,7 +1762,7 @@ private void GetRowHandles(/*int skipCount*/)
ProcessResults(hr);
}
_isRead = ((OleDbHResult.DB_S_ENDOFROWSET != hr) || (0 < (int)_rowFetchedCount));
_rowFetchedCount = (IntPtr)Math.Max((int)_rowFetchedCount, 0);
_rowFetchedCount = Math.Max((int)_rowFetchedCount, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if nint.Max(_rowFetchedCount, 0) would better match the intent or if explicitly truncating down to int was the intent...

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
@jkotas
Copy link
Member

jkotas commented Sep 13, 2022

I have not found any place in the delta where checked arithmetic is desired. Many places can be simplified now that unchecked arithmetic is the default.

@buyaa-n
Copy link
Member Author

buyaa-n commented Sep 20, 2022

Update: The PR is almost ready, just waiting the analyzer PR got merged and built for dogfood, then I will add the update the runtime analyzer version with that build

@buyaa-n
Copy link
Member Author

buyaa-n commented Oct 5, 2022

2 of the failures related to #76280 and #76617
Failure on mono minijit Pri0 Runtime Tests Run OSX x64 release leg has no log kept:

{"Message":"NotFound","ActivityId":"8f3ec23252664ef60980808019c421ce"}

Not sure were to report that, anyway don't think its related, merging

@buyaa-n buyaa-n merged commit 691cf0f into dotnet:main Oct 5, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2022
@buyaa-n buyaa-n deleted the fix-findings branch November 16, 2022 23:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants