diff options
author | Marek Safar <marek.safar@gmail.com> | 2015-08-31 16:23:59 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2015-08-31 16:23:59 +0300 |
commit | 2701b194139f851f54660bd66c97074b041427fd (patch) | |
tree | faaf322b21d7e4378ad124b9b06dce03491dbb80 | |
parent | 6dec86a02329bc46a30b3cdbc8c7bd6554e821de (diff) |
Revert "[mcs] Don't report error for warnings which are not intended to be compiler warnings. Fixes #33487"mono-4.2.0.207
This reverts commit 6dec86a02329bc46a30b3cdbc8c7bd6554e821de.
-rw-r--r-- | mcs/errors/cs1904.cs | 4 | ||||
-rw-r--r-- | mcs/mcs/settings.cs | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/mcs/errors/cs1904.cs b/mcs/errors/cs1904.cs index 441753793d4..a551c2a7cde 100644 --- a/mcs/errors/cs1904.cs +++ b/mcs/errors/cs1904.cs @@ -1,6 +1,6 @@ -// CS1904: `4013' is not a valid warning number +// CS1904: `-1' is not a valid warning number // Line: 0 -// Compiler options: -nowarn:4014,4013 +// Compiler options: -nowarn:1,-1 class ClassMain { public static void Main () {} diff --git a/mcs/mcs/settings.cs b/mcs/mcs/settings.cs index 1fa3f376a4d..9b366d636d8 100644 --- a/mcs/mcs/settings.cs +++ b/mcs/mcs/settings.cs @@ -583,21 +583,15 @@ namespace Mono.CSharp { { bool valid = true; foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) { - var warning = wid; - if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S') - warning = warning.Substring (2); - int id; - if (!int.TryParse (warning, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) { + if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) { + report.Error (1904, "`{0}' is not a valid warning number", wid); + valid = false; continue; } - if (report.CheckWarningCode (id, Location.Null)) { + if (report.CheckWarningCode (id, Location.Null)) action (id); - } else { - report.Error (1904, "`{0}' is not a valid warning number", wid); - valid = false; - } } return valid; |