[Mono-bugs] [Bug 35973][Nor] New - Coversion of IntPtr to void* causes error CS0030

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
19 Dec 2002 22:09:07 -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 akpoon@excite.com.

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

--- shadow/35973	Thu Dec 19 17:09:07 2002
+++ shadow/35973.tmp.22524	Thu Dec 19 17:09:07 2002
@@ -0,0 +1,58 @@
+Bug#: 35973
+Product: Mono/MCS
+Version: unspecified
+OS: SuSE 8.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: akpoon@excite.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Coversion of IntPtr to void* causes error CS0030
+
+Description of Problem:
+  IntPtr cannot be casted to void* (see test case)
+
+Steps to reproduce the problem:
+1. See test case
+
+using System;
+
+namespace IntPtr_Conv
+{
+  struct FooStruct
+  {
+    int x;
+  }
+
+  class Class1
+  {
+    static void Main(string[] args)
+    {
+      IntPtr[] pArray = new IntPtr[1]{IntPtr.Zero};
+
+      unsafe 
+      {
+        // mcs failed with cs0030
+        FooStruct* s = (FooStruct*)(pArray[0]);
+      }
+    }
+  }
+}
+
+Actual Results:
+  mcs failed to compile. report cs0030: cannot convert 'void*' to 'FooStruct*'
+
+Expected Results:
+  mcs should compile properly since VS.Net Studio is compiling the code.
+
+How often does this happen? 
+  100%
+
+Additional Information: