Join GitHub today
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.