Issue reported in https://github.com/dotnet/corefx/issues/31456
Solution is to compare always against IntPtr.Zero and use Roslyn
stric mode for reporting warnings for IntPtr == null comparisons
<PropertyGroup>
<CL_MPCount>$(NumberOfCores)</CL_MPCount>
</PropertyGroup>
+ <PropertyGroup>
+ <!-- Enables Strict mode for Roslyn compiler -->
+ <Features>strict</Features>
+ </PropertyGroup>
</Project>
internal static unsafe void ConvertToManaged(StringBuilder sb, IntPtr pNative)
{
- if (pNative == null)
+ if (pNative == IntPtr.Zero)
return;
int nbBytes = StubHelpers.strlen((sbyte*)pNative);