[Issue 4835] DMD should warn about integer overflow in computed constant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 26 13:14:10 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=4835


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com


--- Comment #6 from Walter Bright <bugzilla at digitalmars.com> 2013-03-26 13:14:08 PDT ---
uint foo() {
    uint x = 1 << 40;
    return 1 << 90;
}

gives:

foo2.d(3): Error: shift by 40 is outside the range 0..31
foo2.d(4): Error: shift by 90 is outside the range 0..31

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


More information about the Digitalmars-d-bugs mailing list