Skip to content

Request: Treat UnconditionalSuppressMessageAttribute like SuppressMessageAttribute #48885

Closed
@agocke

Description

@agocke

History: SuppressMessageAttribute has a ConditionalAttribute on it so it doesn't get emitted. But tools like the linker need a way for code to suppress warnings and a way to see those suppressions in the final binaries.

UnconditionalSuppressMessage was added for this purpose.

We're now trying to add analyzers to produce the same warnings that the linker produces, but at build time. If the analyzer infrastructure doesn't recognize UnconditionalSuppress users will have to annotate their code twice (and it will cause new previously suppressed warnings to appear when we turn on the analyzer).

Overall, we think this is critical for the linker to be successful in the .NET 6 epic of producing a good trimming experience (dotnet/runtime#43543).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions