Skip to content

Commit

Permalink
Enforce IL linker warnings while building CoreLib (dotnet#402)
Browse files Browse the repository at this point in the history
Contributes to dotnet#106
  • Loading branch information
jkotas committed Nov 29, 2020
1 parent af1adf4 commit 4454407
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ public static void PrepareDelegate(Delegate d)
throw new ArgumentNullException(nameof(d));
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2059:UnrecognizedReflectionPattern",
Justification = "We keep class constructors of all types with an EEType")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072:UnrecognizedReflectionPattern",
Justification = "Constructed EEType of a Nullable forces a constructed EEType of the element type")]
public static object GetUninitializedObject(
// This API doesn't call any constructors, but the type needs to be seen as constructed.
// A type is seen as constructed if a constructor is kept.
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/illink-sharedframework.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
-->
<LinkerNoWarn Condition="'$(TargetOS)' != 'windows'">$(LinkerNoWarn);IL2008</LinkerNoWarn>
<LinkerNoWarn Condition="'$(Platform)' != 'x64' AND '$(Platform)' != 'arm64'">$(LinkerNoWarn);IL2012</LinkerNoWarn>
<!-- https://github.com/dotnet/runtimelab/issues/106 - warnings suppressed for NativeAOT CoreLib -->
<LinkerNoWarn>$(LinkerNoWarn);IL2059;IL2072;IL2075;IL2080</LinkerNoWarn>
<ILLinkArgs>$(ILLinkArgs) --nowarn $(LinkerNoWarn)</ILLinkArgs>
</PropertyGroup>

Expand Down

0 comments on commit 4454407

Please sign in to comment.