golang/go

cmd/cgo: _GoString_ is a reserved identifier

Aperta

#29.877 aperta il 22 gen 2019

 (5 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
NeedsFixcompiler/runtimehelp wanted

Metriche repository

Star
 (133.883 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

(Removing the template since this is not really a code bug or so.)

https://golang.org/cmd/cgo/#hdr-Go_references_to_C explains that there's a type _GoString_. However, that name is reserved (see https://en.cppreference.com/w/c/language/identifier#Reserved_identifiers), and using it is technically undefined behavior. I'd suggest renaming the type to just GoString in future versions, with the old name as undocumented and deprecated alias.

Guida contributor