]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: fix unused parameter warnings in generated _cgo_main.c
authorHans <hzb153@gmail.com>
Fri, 30 Jul 2021 02:36:02 +0000 (02:36 +0000)
committerIan Lance Taylor <iant@golang.org>
Mon, 16 Aug 2021 23:03:03 +0000 (23:03 +0000)
commitdf9c5d8f5dc96977dad865dc531d6c1e665ea1cb
tree13e9cdba144dd55314e05b85b97a1a6d8321754e
parent213e157d3aad3fbb289d184a5cb4b18258162634
cmd/cgo: fix unused parameter warnings in generated _cgo_main.c

Applying -Werror compiler option to request warnings is an usual
way to discover potential errors. Go user may put a cgo directive
in preamble: `// #cgo CFLAGS: -Werror=unused-parameter`.

However, the directive also takes effect on the cgo generated files.
I cleaned _cgo_main.c to help Go user only concentrate on warnings
of their own file.

Fixes #43639

Change-Id: I9112f02ae5226f2fc87a8650d19faee59cddd588
GitHub-Last-Rev: f09d172f979acfba855be8108e7d79ec2778c406
GitHub-Pull-Request: golang/go#46358
Reviewed-on: https://go-review.googlesource.com/c/go/+/322232
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
misc/cgo/test/testdata/issue43639.go [new file with mode: 0644]
misc/cgo/test/testdata/issue43639/a.go [new file with mode: 0644]
src/cmd/cgo/out.go