-
Notifications
You must be signed in to change notification settings - Fork 763
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
F# compiler option --nowarn does not accept alphanumeric warning codes #3626
Comments
From @forki on September 22, 2017 5:43 I tink it should be posted in https://github.com/Microsoft/visualfsharp |
Seems like a reasonable suggestions, just out of curiosity: what does the |
Okay ... so we won't validate the alpha chars, and we will only not warn for fsxxxx numbers. And I guess we will need to make sure that we keep the arguments as passed and pass them through the compilation ... Does that sound like what we need?. |
@KevinRansom: NUxxxx warnings are NuGet related warnings which were recently added. Your description seems about right. The same warning codes should be acceptable in |
Yeah ... C# is broken, so I will not make this change in the compiler. I will fix the issue in the targets file or build task, I will just strip out values our compiler doesn't understand we don't understand.. The C# bug:
Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608) Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used
Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
C# ignores any non numeric value including cs0219. It is a C# bug, and it is very likely it won't get fixed. |
@KevinRansom Thanks for the detailed response. I have one correction -
Note that it is case sensitive, so |
I just wished nuget would not mess with compiler flags. But it seems it's
too late. Again...
Am 23.09.2017 01:51 schrieb "Ankit Mishra" <notifications@github.com>:
… @KevinRansom <https://github.com/kevinransom> Thanks for the detailed
response.
I have one correction - /nowarn:CS0219 works as expected -
F:\validation\test\addpkg>csc Program.cs /nowarn:CS0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.
F:\validation\test\addpkg>csc Program.cs /nowarn:CS0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.
F:\validation\test\addpkg>csc Program.cs /nowarn:cs0219
Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
Copyright (C) Microsoft Corporation. All rights reserved.
Program.cs(9,17): warning CS0219: The variable 'x' is assigned but its value is never used
F:\validation\test\addpkg>
Note that it is case sensitive, so cs0219 is not the same as CS0219.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3626 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNO4Cn6DlHYyH3qZslm44bR1FViO_ks5slEgRgaJpZM4PhC1J>
.
|
@forki ... it's 6 of one, half a dozen of the other. Clearly that C# doesn't validate arguments is a bug ... however ... it is convenient that no UI is needed to add the nuget nowarn setting in VS because they can re-use the nowarnings field in the compiler settings. So I can see it both ways ... anyway ... it is no big deal |
It's convenient and wrong.
Am 23.09.2017 05:07 schrieb "Kevin Ransom (msft)" <notifications@github.com
…:
@forki <https://github.com/forki> ... it's 6 of one, half a dozen of the
other.
Clearly that C# doesn't validate arguments is a bug ... however ... it is
convenient that no UI is needed to add the nugget nowarn setting in VS
because they can re-use the nowarnings field in the compiler settings.
So I can see it both ways ... anyway ... it is no big deal
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3626 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNAcDggtf2sUNwaHRQwGs8aljDJbzks5slHXpgaJpZM4PhC1J>
.
|
For reference, the C# compiler does this because it runs analyzers (which have their own custom error prefixes) and emits the diagnostics from analyzers, and allows suppression with |
I.e., it's not so much for other exes in the build like NuGet, etc, as it is for other analyzers running within csc.exe. |
From @mishra14 on September 21, 2017 20:1
Stemming from: NuGet/Home#5913
It seems that F# compiler option --nowarn only accepts integers. Which seems fine based on the description on the docs page.
But the docs also state that the option is equivalent to C# compiler option /nowarn. But the C# compiler option accepts alpha-numeric codes like /nowarn:CS0219
IMO, either the two should be equivalent or maybe the docs should not state them as equivalent.
Please let me know, if this is not the right place for it or it needs to be in fslang-suggestions.
Copied from original issue: fsharp/fsharp#785
The text was updated successfully, but these errors were encountered: