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

Add flag to upgrade warnings to errors #812

Open
Timmmm opened this issue Dec 5, 2024 · 3 comments
Open

Add flag to upgrade warnings to errors #812

Timmmm opened this issue Dec 5, 2024 · 3 comments

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Dec 5, 2024

Would you be ok with a --warnings-as-errors flag, like -Werror in C? I can implement it if so...

@Alasdair
Copy link
Collaborator

Alasdair commented Dec 5, 2024

I'm not sure, I think that -Werror is often misused. The problem from my perspective is if people start doing things like using -Werror in CI, then I can't create new warnings without causing issues for users (even if that's arguably what they signed up for by using the flag).

@Timmmm
Copy link
Contributor Author

Timmmm commented Dec 5, 2024

Hmm what about if you have to specify a target version to enable errors for? I.e. --warnings-as-errors=0.18, which would mean any warnings added in version 0.18 or earlier become errors, but warnings added afterwards are just warnings. That way adding new warnings is never a breaking change.

It's a little bit like how Android target versions, or CMake policies or Rust editions work.

Would you have made some warnings errors by in the first place if backwards compatibility wasn't a concern? E.g. missing pure/impure, or missing register initialisers? If so maybe the best option is to not have this flag and instead require specifying an edition or target version. Then you can gradually transition those to errors for everyone.

@Alasdair
Copy link
Collaborator

Alasdair commented Dec 6, 2024

That would be good, but it would require a lot of work to categorise all the warnings we have.

Would you have made some warnings errors by in the first place if backwards compatibility wasn't a concern?

Yes, often the idea is to make something a warning first then transition it to an error later.

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

No branches or pull requests

2 participants