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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 26 11:27:25 PDT 2013


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



--- Comment #3 from bearophile_hugs at eml.cc 2013-03-26 11:27:23 PDT ---
An example in Go language:


package main
func main() {
    var x uint32 = 1 << 40
    var y = 1024 * 1024 * 1024 * 6
}


The Go compiler gives the errors:

test.go:3: constant 1099511627776 overflows uint32
test.go:4: constant 6442450944 overflows int

-- 
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