Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/cgo: don't accept mangled C names in Cgo programs #28721
What version of Go are you using (
I believe the bug is that Go accepts the program, but shouldn't, while go/types correctly rejects the program. _Ctype_struct_a is not a defined type, and the program only builds because of the way Cgo mangles C type names. @ianlancetaylor do you agree? If so, should Go reject such programs?
I believe the correct fix is to change to program to use C.a instead, as suggested by AlexRouSg.