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

Wish: attributes to disable warnings #15893

Closed
ana-borges opened this issue Apr 2, 2022 · 2 comments · Fixed by #16902
Closed

Wish: attributes to disable warnings #15893

ana-borges opened this issue Apr 2, 2022 · 2 comments · Fixed by #16902
Labels
kind: user messages Improvement of error messages, new warnings, etc. kind: wish Feature or enhancement requests. part: attributes #[attributes] modify the behaviour of vernac sentences.
Milestone

Comments

@ana-borges
Copy link
Contributor

Sometimes the desired way to deal with a warning is to locally disable it. This is particularly obvious for the several warnings generated by importing MathComp, but it is also true in other circumstances, such as overriding notations, declaring nonuniform coercions that don't have a uniform version, declaring a coercion that leads to ambiguous paths we don't care about, etc.

There is already a way to deal with this, which is to disable and enable the warnings surrounding the problematic lines:

Set Warnings "-notation-overridden, -ambiguous-paths".
From mathcomp Require Import all_ssreflect.
Set Warnings "notation-overridden, ambiguous-paths".

However, it would be nicer if there were attributes for disabling each warning (or a sensible subset of the warnings), such as the nonuniform one implemented recently in #15853.

@ana-borges ana-borges added kind: user messages Improvement of error messages, new warnings, etc. kind: wish Feature or enhancement requests. labels Apr 2, 2022
@Zimmi48
Copy link
Member

Zimmi48 commented Apr 3, 2022

I support this feature request, but what I would recommend is a generic attribute that can be used to disable locally any warning specified by its name or category.

@Zimmi48
Copy link
Member

Zimmi48 commented Apr 3, 2022

On the other hand, having specific attributes for commands where we expect a warning that makes sense to disable, like in #15853, also makes sense.

@Alizter Alizter added the part: attributes #[attributes] modify the behaviour of vernac sentences. label Apr 3, 2022
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Nov 24, 2022
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Nov 25, 2022
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Nov 25, 2022
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Dec 5, 2022
SkySkimmer added a commit to SkySkimmer/coq that referenced this issue Dec 6, 2022
@coqbot-app coqbot-app bot added this to the 8.18+rc1 milestone Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: user messages Improvement of error messages, new warnings, etc. kind: wish Feature or enhancement requests. part: attributes #[attributes] modify the behaviour of vernac sentences.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants