-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/gc: compiler must not accept p-notation floats in regular Go code #9036
Comments
I can go either way but I would be ok supporting them. If we do, I propose one of these productions: pfloat_lit = int_lit ( "p" | "P" ) [ "+" | "-" ] decimals . or pfloat_lit = decimal_lit ( "p" | "P" ) [ "+" | "-" ] decimals . i.e., if we permit non-decimal mantissa, we should permit any integer notation. |
There are several related errors: http://play.golang.org/p/VVK5tF24e2
|
What is this "export data"? I've been trying to figure out the conditions under which 'p' and 'P' etc should not be rejected? |
The export data is what compiler read from already compiled Go packages.
They are mostly regular Go declarations with some extensions (hex float,
argument escape tagging, etc)
Open a Go .a file under pkg directory with a text editor and you will see.
|
"Export data" is the textual (go-syntax like) representation of the package "objects" that are exported from the package. The export data of a package A is parsed when another package B imports A. The export data can be found in the object/archive file. The p-format is used to read and write floating-point numbers quickly and accurately without the need to convert to a decimal exponent. |
@dr2chase see also the go/internal/gcimporter package and cmd/compile/internal/gc/export.go |
CL https://golang.org/cl/10450 mentions this issue. |
The text was updated successfully, but these errors were encountered: