[Mono-bugs] [Bug 75861][Nor] New - CS0233 is not reported for using sizeof

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Aug 20 09:19:30 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 gert.driesen at pandora.be.


--- shadow/75861	2005-08-20 09:19:30.000000000 -0400
+++ shadow/75861.tmp.30623	2005-08-20 09:19:30.000000000 -0400
@@ -0,0 +1,41 @@
+Bug#: 75861
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: CS0233 is not reported for using sizeof
+mcs does not report error CS0233 when sizeof is not used in an unsafe 
+To reproduce, compile the following code snippet:
+using System;
+public class Test
+	public static void Main ()
+	{
+		Console.WriteLine (sizeof (short));
+	}
+Actual result:
+Successful compilation
+Expected result:
+test.cs(7,22): error CS0233: sizeof can only be used in an unsafe context
+        (consider using System.Runtime.InteropServices.Marshal.SizeOf)

More information about the mono-bugs mailing list