From 2701b194139f851f54660bd66c97074b041427fd Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 31 Aug 2015 15:23:59 +0200 Subject: Revert "[mcs] Don't report error for warnings which are not intended to be compiler warnings. Fixes #33487" This reverts commit 6dec86a02329bc46a30b3cdbc8c7bd6554e821de. --- mcs/errors/cs1904.cs | 4 ++-- 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; -- cgit v1.2.3