]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: support large unsigned macros
authorHiroshi Ioka <hirochachacha@gmail.com>
Tue, 16 May 2017 12:52:41 +0000 (21:52 +0900)
committerIan Lance Taylor <iant@golang.org>
Wed, 17 May 2017 14:42:29 +0000 (14:42 +0000)
commit7555a45dc2ef22f2afe7f1cc78fc313fd0365735
tree998216b589ef2f4308db283e54925fd0dfee40f5
parentc20e54533ea49ca68640d9a59c9ed935b27da8e5
cmd/cgo: support large unsigned macros

Currently, cgo converts integer macros into int64 if it's possible.
As a result, some macros which satisfy

math.MaxInt64 < x <= math.MaxUint64

will lose their original values.

This CL introduces the new probe to check signs,
so we can handle signed ints and unsigned ints separately.

Fixes #20369

Change-Id: I002ba452a82514b3a87440960473676f842cc9ee
Reviewed-on: https://go-review.googlesource.com/43476
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
misc/cgo/test/cgo_test.go
misc/cgo/test/issue20369.go [new file with mode: 0644]
src/cmd/cgo/gcc.go
src/cmd/cgo/main.go