da769814b8
Before GCC 8 C code like const unsigned long long int neg = (const unsigned long long) -1; void f(void) { static const double x = (neg); } would get an error "initializer element is not constant". In GCC 8 and later it does not. Because a value like neg, above, can not be used as a general integer constant, this causes cgo to conclude that it is a floating point constant. The way that cgo handles floating point values then causes it to get the wrong value for it: 18446744073709551615 rather than -1. These are of course the same value when converted to int64, but Go does not permit that kind of conversion for an out-of-range constant. This CL side-steps the problem by treating floating point constants with integer type as they would up being treated before GCC 8: as variables rather than constants. Fixes #26066 Change-Id: I6f2f9ac2fa8a4b8218481b474f0b539758eb3b79 Reviewed-on: https://go-review.googlesource.com/121035 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.