-
Couldn't load subscription status.
- Fork 1.2k
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.
NoWarnshould simply be passed to the linker. It will ignore error codes that don't begin withIL.WarningsAsErrors/WarningsNotAsErrorssimilarly should be passed directly to the linker.TreatWarningsAsErrorsshould 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.AnalysisLevelshould set a linker-specific property (tentativelyILLinkWarningVersion), which gets passed to the linker to control warning versions. The linker-specific property is similar toWarningLevelfor the compiler (see https://github.com/dotnet/sdk/pull/12422/files). I'm suggestingVersioninstead ofLevelbecause 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