[Mono-bugs] [Bug 75984][Nor] New - [PATCH] Several preprocessor handling bugfixes

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Sep 5 04:36:07 EDT 2005


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 atsushi at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=75984

--- shadow/75984	2005-09-05 04:36:07.000000000 -0400
+++ shadow/75984.tmp.4886	2005-09-05 04:36:07.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 75984
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] Several preprocessor handling bugfixes
+
+Copying from
+http://lists.ximian.com/pipermail/mono-devel-list/2005-August/014329.html
+
+As for existing mcs:
+
+	- It didn't report expected location (tiny fix).
+	- When -langversion:ISO-1 is specified, #pragma directive
+	  is always checked, even when it is actually disabled
+	  by #if directive. (Because of this bug, currently
+	  mscorlib cannot be compiled with csc.)
+	- Syntax for #define and #undef are checked even when
+	  they are inside disabled block.
+	- On the other hand, syntax for #line directive is
+	  not checked unless it is enabled.
+
+-------- repro
+#if false
+#line hahaha // invalid format -> no error
+#error
+#line hahaha // invalid format -> no error
+#undef // without identifier -> error
+#line hahaha // invalid format -> no error
+#pragma warning disable 3005 // wrong directive on csc 1.x
+	public class Foo
+	{
+	}
+#pragma warning restore // wrong directive on csc 1.x
+
+#region // blank -> no error
+#endregion
+#region Foo // without endregion -> error
+#hogehoge // wrong directive
+
+#endif
+--------
+
+Actual Results:
+
+pragma-warning.cs(1,1): error CS1576: The line number specified for #line
+directive is missing or invalid
+pragma-warning.cs(1,1): error CS1576: The line number specified for #line
+directive is missing or invalid
+pragma-warning.cs(1,1): error CS1576: The line number specified for #line
+directive is missing or invalid
+pragma-warning.cs(1,1): warning CS1691: `3005' is not a valid warning number
+pragma-warning.cs(1,1): error CS1038: #endregion directive expected
+pragma-warning.cs(1,1): error CS1027: Expected `#endif' directive
+error CS1027: Expected `#endif' directive
+Compilation failed: 6 error(s), 1 warnings
+
+Expected Results:
+
+pragma-warning.cs(5,8): error CS1001: Identifier expected
+pragma-warning.cs(16,2): error CS1024: Preprocessor directive expected
+pragma-warning.cs(18,2): error CS1038: #endregion directive expected
+pragma-warning.cs(20,1): error CS1027: #endif directive expected
+
+This had been blocking mscorlib compilation with csc (as ConsoleKey.cs was
+incorrectly allowed to have such code).


More information about the mono-bugs mailing list