[Mono-bugs] [Bug 22564] New - Combination of #define and nested #if: missing #endif not detected

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
26 Mar 2002 21:11:04 -0000


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 duco@lorentz.xs4all.nl.

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

--- shadow/22564	Tue Mar 26 16:11:04 2002
+++ shadow/22564.tmp.31394	Tue Mar 26 16:11:04 2002
@@ -0,0 +1,53 @@
+Bug#: 22564
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: SuSE Linux 7.1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: duco@lorentz.xs4all.nl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Combination of #define and nested #if: missing #endif not detected
+
+Description of Problem:
+In a nested usage of #if, a missing #endif is not always detected 
+
+Steps to reproduce the problem:
+
+#define MYSYMBOL
+
+using System;
+
+namespace Test {
+
+public class Test {
+
+#if MYSYMBOL
+        public static int JustAFunction () { return 42; }
+#if NOTDEFINED
+        public static int JustAnotherFunction () { return 37; }
+#endif
+// An #endif is missing, a fact not detected by mcs
+
+        public static void Main ()
+        {
+                Console.WriteLine (JustAFunction ());
+        }
+}
+
+Actual Results:
+When the program above is compiled, no syntax error is given indicating the
+missing #endif. When the #define is removed, a syntax error IS given. 
+
+Expected Results:
+A syntax error like "#endif missing" 
+
+How often does this happen? 
+Always