You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.8.3 windows/amd64
Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\dev\gopath
set GORACE=
set GOROOT=E:\Go
set GOTOOLDIR=E:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
Assign a uint64 number to type of uint, it can build and run.
package main
import (
"fmt"
"math"
"runtime"
)
func main() {
var a uint = math.MaxUint64
fmt.Println("Hello, playground", a, runtime.Version())
}
What did you expect to see?
Build error with messge: constant 18446744073709551615 overflows uint
What did you see instead?
Hello, playground 18446744073709551615 go1.8.3
The text was updated successfully, but these errors were encountered:
Thank you for raising this issue. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process.
uint is a variable sized type, on your 64 bit computer uint is 64 bits wide.
mikioh
changed the title
uint assignment overflow but compile doesn't report error.
math: uint assignment overflow but compile doesn't report error.
Jan 5, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.3 windows/amd64
Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\dev\gopath
set GORACE=
set GOROOT=E:\Go
set GOTOOLDIR=E:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
Assign a
uint64
number to type of uint, it can build and run.What did you expect to see?
Build error with messge: constant 18446744073709551615 overflows uint
What did you see instead?
Hello, playground 18446744073709551615 go1.8.3
The text was updated successfully, but these errors were encountered: