8000 Pass warning options to ILLink · Issue #12601 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content
Pass warning options to ILLink #12601
@sbomer

Description

@sbomer

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 with IL.
  • WarningsAsErrors/WarningsNotAsErrors similarly should be passed directly to the linker.
  • TreatWarningsAsErrors should set another linker-specific property (tentatively ILLinkTreatWarningsAsErrors) 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 (tentatively ILLinkWarningVersion), which gets passed to the linker to control warning versions. The linker-specific property is similar to WarningLevel for the compiler (see https://github.com/dotnet/sdk/pull/12422/files). I'm suggesting Version instead of Level 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0