-
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: compiler error for C unsigned short is wrong. #13129
Comments
@hydroflame Are you still able to reproduce this? If so, can you provide additional details about your build environment (at least Go version and OS). I can't reproduce this issue at master (e36bf61) on linux/amd64 (Ubuntu 14.04):
|
Ah, nevermind, I can repro with Clang:
|
Comparing the names in cmd/cgo/gcc.go:dwarfToName and https://github.com/llvm-mirror/clang/blob/master/lib/Basic/TargetInfo.cpp#L107, it looks like the only differences are that Clang uses "short" and "unsigned short" instead of "short int" and "short unsigned int", respectively. "short" doesn't need to be mapped, so that just leaves "unsigned short". |
|
CL https://golang.org/cl/17207 mentions this issue. |
When trying to assign a variable of the wrong type to a C.ushort. The compiler will emit the error
cannot use <var> (type <var type>) as type C.unsignedshort in assignment
. HoweverC.unsignedshort
isn't even a real type. It should sayC.ushort
short test program:
package main
The text was updated successfully, but these errors were encountered: