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

Implement compiler flag /warnversion #45702

Closed
gafter opened this issue Jul 6, 2020 · 2 comments · Fixed by #45750
Closed

Implement compiler flag /warnversion #45702

gafter opened this issue Jul 6, 2020 · 2 comments · Fixed by #45750
Assignees
Labels
Milestone

Comments

@gafter
Copy link
Member

gafter commented Jul 6, 2020

From #45701

Implement a /warnversion:version command-line switch

  1. The version is going to start at 5 and increase monotonically with new compiler releases. It is a decimal value.
    Open Question: do we bump the number for .NET releases or language releases? Today they will be the same but what if that changes?
  2. For each warning, the compiler knows which version the warning was introduced in.
  3. For any warning that the compiler wishes to emit, it first checks it against /warnversion. If the warning is more recent then it isn't emitted, and can't be controlled by /warnaserror, and #pragma warning restore cannot enable it. For all other subsystems in the compiler, it's as if this warning doesn't exist. If you /warnaserror:WRNID one of these warnings, it silently has no effect.
  4. If /warnversion specifies a version more recent than the current compiler, then the compiler silently uses the most recent version it can. If no /warnversion is specified then none of the warning-wave warnings will be produced.
@CyrusNajmabadi
Copy link
Member

The version is going to start at 5 and increase monotonically with new compiler releases

I personally don't like that. It makes it feel like i should be ablet o map that value to some value from elsewhere in the ecosystem (i.e. .net version, etc.). I don't see how they're tied together so i would prefer to explicitly not make them seem similar.

It is a decimal value.

I don't like that either. what is a fractional warning wave? i.e. i would not expect to enable warning wave 2 and 2.1 and 2.2. I would prefer it was just integral, and we had a clear doc saying: this warning wave integral value added exactly tehse warnings.

@gafter
Copy link
Member Author

gafter commented Jul 7, 2020

The warning wave number aligns with the version of the dotnet platform in which the warning was introduced.

It is a decimal value because we don't know if dotnet versions will be integral in the future (e.g. dotnet 3.1), or if there will be a release of a component containing the compiler between dotnet versions.

@ghost ghost closed this as completed in #45750 Jul 16, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants