www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11612] New: Inconsistent error on negative new array size

https://d.puremagic.com/issues/show_bug.cgi?id=11612

           Summary: Inconsistent error on negative new array size
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: yebblies gmail.com


--- Comment #0 from yebblies <yebblies gmail.com> 2013-11-27 13:52:17 EST ---
This program

void main()
{
    auto x = new int[-1];
}

compiles with no error with -m32, but with -m64 gives this error:

testx.d(4): Error: negative array index 18446744073709551615LU

This should behave the same on both platforms, one way or the other

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2013