Skip to content

Commit

Permalink
Suppress more trim analysis warnings
Browse files Browse the repository at this point in the history
The following also belong to the trim analysis category:
- IL2050 (dotnet/linker#1430)
- Warnings about invalid attributes
- Warnings about uses of removed attributes
  • Loading branch information
sbomer committed Aug 14, 2020
1 parent 03ef385 commit 1d3018b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,24 @@ Copyright (c) .NET Foundation. All rights reserved.
</PropertyGroup>

<PropertyGroup Condition=" '$(SuppressTrimAnalysisWarnings)' == 'true' ">
<!-- RequiresUnreferenceCodeAttribute method called -->
<NoWarn>$(NoWarn);IL2026</NoWarn>
<!-- Invalid use of DynamicallyAccessedMembersAttribute -->
<NoWarn>$(NoWarn);IL2041;IL2042;IL2043;IL2056</NoWarn>
<!-- Reference to removed attribute type -->
<NoWarn>$(NoWarn);IL2045</NoWarn>
<!-- RequiresUnreferencedCodeAttribute mismatch on virtual override -->
<NoWarn>$(NoWarn);IL2046</NoWarn>
<!-- COM marshalling warning -->
<NoWarn>$(NoWarn);IL2050</NoWarn>
<!-- Reflection intrinsics with unknown arguments -->
<NoWarn>$(NoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061</NoWarn>
<!-- Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
<NoWarn>$(NoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</NoWarn>
<!-- Unsatisfied DynamicallyAccessedMembers requirements -->
<NoWarn>$(NoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091</NoWarn>
<!-- RequiresUnreferenceCodeAttribute method called -->
<NoWarn>$(NoWarn);IL2026</NoWarn>
<!-- DynamicallyAccessedMembersAttribute mismatch on virtual override -->
<NoWarn>$(NoWarn);IL2092;IL2093;IL2094;IL2095</NoWarn>

<!-- Warnings from the framework. Can be removed once https://github.com/dotnet/runtime/issues/40336 is fixed. -->
<!-- Framework embedded XML descriptors reference windows-only members. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ public void ILLink_analysis_warnings_are_disabled_by_default(string targetFramew
// trim analysis warnings are disabled
.And.NotHaveStdOutContaining("warning IL2075")
.And.NotHaveStdOutContaining("warning IL2026")
// warnings about invalid attributes still show up
.And.HaveStdOutContaining("warning IL2043")
.And.HaveStdOutContaining("warning IL2046")
.And.HaveStdOutContaining("warning IL2093");
.And.NotHaveStdOutContaining("warning IL2043")
.And.NotHaveStdOutContaining("warning IL2046")
.And.NotHaveStdOutContaining("warning IL2093");
}

[RequiresMSBuildVersionTheory("16.8.0")]
Expand Down

0 comments on commit 1d3018b

Please sign in to comment.