Bugzilla – Bug 318783
CS0233 is not reported for using sizeof
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by gert.driesen@pandora.be 2005-08-20 09:19:30 MST ---- mcs does not report error CS0233 when sizeof is not used in an unsafe context. 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) ---- Additional Comments From duncan@ximian.com 2005-08-20 11:50:36 MST ---- This is a duplicate. *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO75134 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"