зеркало из https://github.com/mono/mail-archives.git
120 строки
4.5 KiB
HTML
120 строки
4.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-bugs] [Bug 75134][Nor] New - CS0233 should be reported for
|
|
sizeof without unsafe context
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075134%5D%5BNor%5D%20New%20-%20CS0233%20should%20be%20reported%20for%0A%09sizeof%20without%20unsafe%20context&In-Reply-To=bug-75134%40chernobyl.ximian.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="029964.html">
|
|
<LINK REL="Next" HREF="029966.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-bugs] [Bug 75134][Nor] New - CS0233 should be reported for
|
|
sizeof without unsafe context</H1>
|
|
<B>bugzilla-daemon at bugzilla.ximian.com</B>
|
|
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075134%5D%5BNor%5D%20New%20-%20CS0233%20should%20be%20reported%20for%0A%09sizeof%20without%20unsafe%20context&In-Reply-To=bug-75134%40chernobyl.ximian.com"
|
|
TITLE="[Mono-bugs] [Bug 75134][Nor] New - CS0233 should be reported for
|
|
sizeof without unsafe context">bugzilla-daemon at bugzilla.ximian.com
|
|
</A><BR>
|
|
<I>Fri Jun 3 00:57:17 EDT 2005</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="029964.html">[Mono-bugs] [Bug 75131][Wis] Changed - Reflector crashes on start
|
|
</A></li>
|
|
<LI>Next message: <A HREF="029966.html">[Mono-bugs] [Bug 75100][Maj] Changed - Custom data formatting
|
|
expressions don't appear to work in DataGrids
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#29965">[ date ]</a>
|
|
<a href="thread.html#29965">[ thread ]</a>
|
|
<a href="subject.html#29965">[ subject ]</a>
|
|
<a href="author.html#29965">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>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 <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">atsushi at ximian.com.</A>
|
|
|
|
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75134">http://bugzilla.ximian.com/show_bug.cgi?id=75134</A>
|
|
|
|
--- shadow/75134 2005-06-03 00:57:17.000000000 -0400
|
|
+++ shadow/75134.tmp.19153 2005-06-03 00:57:17.000000000 -0400
|
|
@@ -0,0 +1,48 @@
|
|
+Bug#: 75134
|
|
+Product: Mono: Compilers
|
|
+Version: 1.1
|
|
+OS:
|
|
+OS Details:
|
|
+Status: NEW
|
|
+Resolution:
|
|
+Severity:
|
|
+Priority: Normal
|
|
+Component: C#
|
|
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">atsushi at ximian.com</A>
|
|
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+TargetMilestone: ---
|
|
+URL:
|
|
+Cc:
|
|
+Summary: CS0233 should be reported for sizeof without unsafe context
|
|
+
|
|
+Currently mcs does not require unsafe context for "sizeof" operator.
|
|
+
|
|
+public class Test
|
|
+{
|
|
+ public void Foo ()
|
|
+ {
|
|
+ int x = sizeof (int);
|
|
+ }
|
|
+}
|
|
+
|
|
+Actual Results:
|
|
+
|
|
+$ mcs sizeof.cs /unsafe
|
|
+sizeof.cs(5) warning CS0219: The variable 'x' is assigned but its value is
|
|
+never used
|
|
+error CS5001: Program sizeof.exe does not have an entry point defined
|
|
+Compilation failed: 1 error(s), 1 warnings
|
|
+
|
|
+Expected Results:
|
|
+
|
|
+$ csc sizeof.cs /unsafe /nologo
|
|
+sizeof.cs(5,11): error CS0233: sizeof can only be used in an unsafe context
|
|
+(consider using System.Runtime.InteropServices.Marshal.SizeOf)
|
|
+
|
|
+How often does this happen?
|
|
+consistently
|
|
+
|
|
+Additional Information:
|
|
+I haven't checked the C# specification in details so drop it if the spec
|
|
+does not require unsafe context.
|
|
</PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="029964.html">[Mono-bugs] [Bug 75131][Wis] Changed - Reflector crashes on start
|
|
</A></li>
|
|
<LI>Next message: <A HREF="029966.html">[Mono-bugs] [Bug 75100][Maj] Changed - Custom data formatting
|
|
expressions don't appear to work in DataGrids
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#29965">[ date ]</a>
|
|
<a href="thread.html#29965">[ thread ]</a>
|
|
<a href="subject.html#29965">[ subject ]</a>
|
|
<a href="author.html#29965">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
|
|
mailing list</a><br>
|
|
</body></html>
|