Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscall: constant overflows int for mips compile #21596

yinheli opened this issue Aug 24, 2017 · 3 comments

syscall: constant overflows int for mips compile #21596

yinheli opened this issue Aug 24, 2017 · 3 comments


Copy link

@yinheli yinheli commented Aug 24, 2017

TUNSETIFF = 0x800454ca

32bit system, int max value: 0x7fffffff (2147483647)

@jessfraz jessfraz changed the title constant overflows int for mips compile syscall: constant overflows int for mips compile Aug 24, 2017
Copy link

@cherrymui cherrymui commented Aug 24, 2017

@yinheli what is the problem? Do you have any program that fails to compile due to this?

The constant itself is ok, because it is an untyped integer instead of int.

Copy link

@yinheli yinheli commented Aug 25, 2017

@cherrymui I'm using to create tun device on mips (openwrt), go build reports:

vendor/ constant 2147767498 overflows int
vendor/ constant 2147767500 overflows int
vendor/ constant 2147767502 overflows int
vendor/ constant 2147767499 overflows int


go version : 1.8.3

build env
GOOS=linux GOARCH=mips

You mean i have to convert the constant value to uint ?
thanks, i'll try to and do some tests

Copy link

@ianlancetaylor ianlancetaylor commented Aug 25, 2017

It should normally work to change the request parameter of ioctl to be uint. That's how the implementations in work.

Closing because I don't think there is anything to change in the main Go repo.

yinheli added a commit to yinheli/water that referenced this issue Aug 28, 2017
issue detail : golang/go#21596
const is untyped int
@golang golang locked and limited conversation to collaborators Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.