-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
The linker is adding options --nowarn
, --warnaserror
, and --warn
to control warning behavior similar to the Roslyn. We need to pass appropriate MSBuild properties as inputs to these in the SDK.
NoWarn
should simply be passed to the linker. It will ignore error codes that don't begin withIL
.WarningsAsErrors
/WarningsNotAsErrors
similarly should be passed directly to the linker.TreatWarningsAsErrors
should set another linker-specific property (tentativelyILLinkTreatWarningsAsErrors
) with the same semantics, which gets passed to the linker. This is to allow the setting to be controlled independently for the linker and the compiler if desired.AnalysisLevel
should set a linker-specific property (tentativelyILLinkWarningVersion
), which gets passed to the linker to control warning versions. The linker-specific property is similar toWarningLevel
for the compiler (see https://github.com/dotnet/sdk/pull/12422/files). I'm suggestingVersion
instead ofLevel
because this is more accurate, whereas Roslyn is repurposing an existing option whose meaning used to be different.
The reason I am suggesting ILLink
as the prefix rather than Trimmer
is that these options are conceptually not specific to trimming - we will use the same properties in the future if we introduce single-file-correctness analysis in the linker.
@samsp-msft again, would appreciate your feedback on the naming.
@vitek-karas @eerhardt