-
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: -godefs dumps C struct members with uppercase even C struct uses lowercase #46332
Comments
It's unclear what your actual problem is. You should fill out the following sections of the issue template:
|
@icholy I think @Robert-M-Muench is reporting that @Robert-M-Muench, please update your original post with more information, ideally following the issue template. |
I thought it was clear from the title, anyway updated my comment to make the problem more explicit. |
The point of the So, what you say is true, but I don't see why it is a problem, or how it could work in any other way. Can you explain what the real issue is? |
I had to use it because CGO doesn't support anonymous structs/unions. Hence, I had to find out how Go/cgo translates anonymous parts, which lead to the Anon0/anon0 discrepancy. |
OK, but I don't see anything to change here. By its nature, |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
go version go1.16 darwin/amd64
The C struct:
gets dumped as:
But can only be accessed by
fm.size
and notfm.Size
as the output suggest. Using the output field names gives:..\windows\text.go:168:51: fm.Anon0 undefined (type _Ctype_struct_BLFontMetrics has no field or method Anon0, but does have anon0)
The upper-case in the output is not what you need to use in your source code.
The output should match exactly what the compiler expects/does.
The text was updated successfully, but these errors were encountered: