dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bug #19129] Reading uninitialised variable does not c


From: anonymous
Subject: [Pnet-developers] [bug #19129] Reading uninitialised variable does not cause compile error.
Date: Fri, 23 Feb 2007 13:43:14 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; da-DK; rv:1.8.0.9) Gecko/20070126 Ubuntu/dapper-security Firefox/1.5.0.9

URL:
  <http://savannah.gnu.org/bugs/?19129>

                 Summary: Reading uninitialised variable does not cause
compile error.
                 Project: DotGNU Portable.NET
            Submitted by: None
            Submitted on: Friday 02/23/2007 at 13:43 UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Reading uninitialised variable does not cause compile error. I was reading
"Programming C#" from Oreley. Example3-2 on page 27 is an example of using an
unitialised variable, see attachment. According to "Programming C#" I am
suposed to get this error message when compiling:

3.1.cs(6,55): error CS0165: Use of unassigned local
variable 'myInt'

But cscc version 0.7.4 compiles without any error, and the program runs
without crashing:

$ cscc Values.cs
$ ilrun a.out
Uninitialized, myInt: 0
Assigned, myInt: 5

According to "Programming C#" it is not legal to use an unitialised variable
in C#.

Example3-2 is attached as Value.cs.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Friday 02/23/2007 at 13:43 UTC  Name: Values.cs  Size: 252B   By: None
Example3-2 from &quot;Programming C#&quot;
<http://savannah.gnu.org/bugs/download.php?file_id=12030>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?19129>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]