cmd/cgo: go build failed on _cgo_main.c if there's '#cgo CFLAGS: -W -Werror' in cgo preamble #43639
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
demo code: https://play.golang.org/p/JybuNyX-bqf
cd to the package directory containing above two files and run
go build
What did you expect to see?
go build ran successfully and nothing outputted
What did you see instead?
_cgo_main.c:2:23: error: unused parameter 'fn' [-Werror,-Wunused-parameter]
_cgo_main.c:2:61: error: unused parameter 'a' [-Werror,-Wunused-parameter]
_cgo_main.c:2:68: error: unused parameter 'c' [-Werror,-Wunused-parameter]
_cgo_main.c:2:85: error: unused parameter 'ctxt' [-Werror,-Wunused-parameter]
_cgo_main.c:4:41: error: unused parameter 'ctxt' [-Werror,-Wunused-parameter]
_cgo_main.c:6:26: error: unused parameter 'a' [-Werror,-Wunused-parameter]
_cgo_main.c:6:33: error: unused parameter 'c' [-Werror,-Wunused-parameter]
_cgo_main.c:7:23: error: unused parameter 'a' [-Werror,-Wunused-parameter]
_cgo_main.c:7:30: error: unused parameter 'c' [-Werror,-Wunused-parameter]
The text was updated successfully, but these errors were encountered: