www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4772] New: DMD allows "dereferencing" arrays as if it were a pointer to first element

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4772

           Summary: DMD allows "dereferencing" arrays as if it were a
                    pointer to first element
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: 2korden gmail.com


--- Comment #0 from Koroskin Denis <2korden gmail.com> 2010-08-31 04:32:44 PDT
---
import std.stdio;
void main()
{
    string foo = "foo";
    int[] bar = [ 42 ];

    writeln(*foo, *bar); // prints "f42"
}

I don't think this is intended and should be disallowed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4772


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #1 from bearophile_hugs eml.cc 2010-08-31 10:31:28 PDT ---
See bug 3990

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4772


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE


--- Comment #2 from yebblies <yebblies gmail.com> 2012-01-29 22:37:16 EST ---
*** This issue has been marked as a duplicate of issue 3990 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2012