main: Add pointer touch to potentially unused CGO generated function parameter
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index 151000f..833dc50 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -795,6 +795,7 @@
fmt.Fprintf(fgcc, "\tchar *_cgo_stktop = _cgo_topofstack();\n")
fmt.Fprintf(fgcc, "\t__typeof__(_cgo_a->r) _cgo_r;\n")
}
+ fmt.Fprintf(fgcc, "\t(void)v;\n")
fmt.Fprintf(fgcc, "\t_cgo_tsan_acquire();\n")
if n.AddError {
fmt.Fprintf(fgcc, "\terrno = 0;\n")
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Congratulations on opening your first change. Thank you for your contribution!
Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://go.dev/s/release
for more details.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
This is similar to a previous fix which handled most (but not all cases).
https://go-review.git.corp.google.com/c/go/+/730600
https://go.dev/issue/76861
We should also update the regression test so that it actually catches this issue
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
fmt.Fprintf(fgcc, "\t(void)v;\n")Please instead use __attribute__((unused)) on the function declaration, as in other cases in this file.
This should have a test that fails without this patch. The test can be a compilation-only test in cmd/cgo/internal/test/test.go.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |