[Mono-bugs] [Bug 50871][Nor] New - warning CS0168 (-warn:4)
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 12 Nov 2003 15:19:45 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by polak@gnu.org.
http://bugzilla.ximian.com/show_bug.cgi?id=50871
--- shadow/50871 2003-11-12 15:19:45.000000000 -0500
+++ shadow/50871.tmp.26127 2003-11-12 15:19:45.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 50871
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: polak@gnu.org
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: warning CS0168 (-warn:4)
+
+mcs -warn:4 (-warn:3) produces the following warning:
+
+ test.cs(7) warning CS0168: The variable `x' is declared but never used
+
+while compiling for instance this `test.cs' below:
+
+using System;
+
+class Test
+{
+ public static void Main ()
+ {
+ int x;
+ Foo (out x);
+ Console.WriteLine ("x: " + x);
+ }
+
+ static void Foo (out int x)
+ {
+ object o = "abc";
+ try {
+ // this should generate
+ // an exception
+ x = Convert.ToInt32 (o);
+ }
+ catch (Exception) {
+ // x = something; is missing!
+ return;
+ }
+ }
+}
+
+Of course mcs shouldn't warn about that.