[Mono-bugs] [Bug 38663][Min] New - pointer to struct compiles, but shouldn't

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 25 Feb 2003 07:16:51 -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 lupus@ximian.com.

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

--- shadow/38663	Tue Feb 25 07:16:51 2003
+++ shadow/38663.tmp.5456	Tue Feb 25 07:16:51 2003
@@ -0,0 +1,36 @@
+Bug#: 38663
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: pointer to struct compiles, but shouldn't
+
+The following sample compiles with mcs, but csc gives an error instead:
+struct pwd {
+	string name;
+};
+
+class T {
+	static void Main () {
+		unsafe {
+			pwd *p;
+		 }
+	}
+}
+
+The csc error is:
+struct-addr.cs(8,8): error CS0208: Cannot take the address or size of a
+variable of a managed type ('pwd')
+
+Note with both compilers using /unsafe is needed.