-
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: inconsistent definitions for C.uint #26743
Comments
CC @randall77 |
What does |
Thanks for the reproduction case. Unfortunately it doesn't build:
When I change the name of |
Can you see if your issue is fixed on tip now that CL 127156 is committed? |
Thanks for feedback. My gcc is:
The sample indeed does not build, after I tried downloading it afresh from here in another directory. I turned out I've made a copy-paste error. Here is correct
(appologize for the pasting mistake on my side). The problem persists with CL 127156 applied:
|
I've edited original issue description and put zstream.go content into there. |
Thanks, I can recreate the problem now. |
Thanks, good. |
I think it's because cgo has its own definition of Shorter repro: a.go: package a
// typedef unsigned int uint;
// int C1(uint x) { return x; }
import "C"
var V1 = C.C1(0) b.go: package a
import "C"
var V2 C.uint |
Change https://golang.org/cl/127356 mentions this issue: |
Thanks for the fix. |
Change https://golang.org/cl/128396 mentions this issue: |
…r for cgo-defined types The cgo tool predefines some C types such as C.uint. Don't give an error if the type that cgo defines does not match the type in a header file. Fixes #26743 Change-Id: I9ed3b4c482b558d8ffa8bf61eb3209415b7a9e3c Reviewed-on: https://go-review.googlesource.com/127356 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit c29370c) Reviewed-on: https://go-review.googlesource.com/128396 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Please answer these questions before submitting your issue. Thanks!
What did you do?
I was trying to rebuild my software with gotip and got the following error:
The build is working with Go1.10 and earlier releases.
What did you expect to see?
Builds ok.
What did you see instead?
The build for github.com/DataDog/czlib fails with
cgo: inconsistent definitions for C.uint
error. I've extracted the minimal reproducer:fastzlib.h
:fastzlib.c
:fastzlib.go
:zstream.go
(EDIT: originally postedfastzlib.go
content here by mistake):Does this issue reproduce with the latest release (go1.10.3)?
No, it is a regression:
System details
The text was updated successfully, but these errors were encountered: