-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/cgo: "could not determine kind of name" for const int when using clang #21668
Comments
What does |
I can reproduce this using clang 3.6. |
No need for foo.h, by the way, this suffices:
|
|
Sorry about the stupid bug. I sent the fix. |
Change https://golang.org/cl/59710 mentions this issue: |
Reopen to commit to 1.9 branch. |
Change https://golang.org/cl/59730 mentions this issue: |
Current code uses names like "x" and "s" which can conflict with user's code easily. Use cryptographic names. Fixes #21668 Change-Id: Ib6d3d6327aa5b92d95c71503d42e3a79d96c8e15 Reviewed-on: https://go-review.googlesource.com/59710 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/59730 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com> Reviewed-by: Chris Broadfoot <cbro@golang.org>
(CL 59710 was already cherry-picked as CL 59730, but then we wiped that out for the Go 1.9.1 security release behind Gerrit's back, and so Gerrit refuses to believe that we could possibly need a second cherry-pick of the same CL. CL 70849 is a cherry-pick but with the Change-Id incremented to break the Gerrit correspondence.) |
Change https://golang.org/cl/70849 mentions this issue: |
Current code uses names like "x" and "s" which can conflict with user's code easily. Use cryptographic names. Fixes #21668 Change-Id: Ib6d3d6327aa5b92d95c71503d42e3a79d96c8e16 Reviewed-on: https://go-review.googlesource.com/59710 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/59730 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com> Reviewed-by: Chris Broadfoot <cbro@golang.org> Reviewed-on: https://go-review.googlesource.com/70849 Run-TryBot: Russ Cox <rsc@golang.org>
go1.9.2 has been packaged and includes: The release is posted at golang.org/dl. — golang.org/x/build/cmd/releasebot, Oct 26 21:09:11 UTC |
Compiling a trivial cgo program fails only with go1.9 on mac. It compiles on go1.8.3 for all platforms, and compiles for go1.9 on linux.
There are two files:
foo.go
foo.h
Note that if you change foo.h removing const it works.
What did you do?
What did you expect to see?
A successful build (or a more useful error message if you are not allowed to reference C.x, and preferably one that was consistent across platforms)
What did you see instead?
System details
The text was updated successfully, but these errors were encountered: