Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Treat UnconditionalSuppressMessageAttribute like SuppressMessageAttribute #48885

Closed
agocke opened this issue Oct 23, 2020 · 2 comments · Fixed by #51792
Closed

Request: Treat UnconditionalSuppressMessageAttribute like SuppressMessageAttribute #48885

agocke opened this issue Oct 23, 2020 · 2 comments · Fixed by #51792

Comments

@agocke
Copy link
Member

agocke commented Oct 23, 2020

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).

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 23, 2020
@agocke agocke added Area-Compilers and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 23, 2020
@agocke
Copy link
Member Author

agocke commented Oct 23, 2020

@jaredpar

@MichalStrehovsky
Copy link
Member

Potentially can be duped with #43639?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants