[go] main: Add pointer touch to potentially unused CGO generated function parameter

0 views
Skip to first unread message

Antonio Ballesteros (Gerrit)

unread,
Aug 11, 2026, 7:49:28 PM (8 hours ago) Aug 11
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Antonio Ballesteros has uploaded the change for review

Commit message

main: Add pointer touch to potentially unused CGO generated function parameter
Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d

Change diff

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")

Change information

Files:
  • M src/cmd/cgo/out.go
Change size: XS
Delta: 1 file changed, 1 insertion(+), 0 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
Gerrit-Change-Number: 813620
Gerrit-PatchSet: 1
Gerrit-Owner: Antonio Ballesteros <agb...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Aug 11, 2026, 7:51:49 PM (8 hours ago) Aug 11
to Antonio Ballesteros, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Message from Gopher Robot

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.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
Gerrit-Change-Number: 813620
Gerrit-PatchSet: 1
Gerrit-Owner: Antonio Ballesteros <agb...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Comment-Date: Tue, 11 Aug 2026 23:51:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Antonio Ballesteros (Gerrit)

unread,
Aug 11, 2026, 7:57:36 PM (8 hours ago) Aug 11
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Antonio Ballesteros uploaded new patchset

Antonio Ballesteros uploaded patch set #2 to this change.
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
Gerrit-Change-Number: 813620
Gerrit-PatchSet: 2
unsatisfied_requirement
satisfied_requirement
open
diffy

Antonio Ballesteros (Gerrit)

unread,
Aug 11, 2026, 8:09:57 PM (7 hours ago) Aug 11
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from David Chase and Joe Richey

Antonio Ballesteros uploaded new patchset

Antonio Ballesteros uploaded patch set #3 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • David Chase
  • Joe Richey
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
Gerrit-Change-Number: 813620
Gerrit-PatchSet: 3
Gerrit-Owner: Antonio Ballesteros <agb...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Joe Richey <joer...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Joe Richey <joer...@google.com>
Gerrit-Attention: David Chase <drc...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Joe Richey (Gerrit)

unread,
Aug 11, 2026, 8:11:27 PM (7 hours ago) Aug 11
to Antonio Ballesteros, goph...@pubsubhelper.golang.org, David Chase, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Antonio Ballesteros and David Chase

Joe Richey voted and added 1 comment

Votes added by Joe Richey

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 2:
Joe Richey . unresolved

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

Open in Gerrit

Related details

Attention is currently required from:
  • Antonio Ballesteros
  • David Chase
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
    Gerrit-Change-Number: 813620
    Gerrit-PatchSet: 2
    Gerrit-Owner: Antonio Ballesteros <agb...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Joe Richey <joer...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Attention: Antonio Ballesteros <agb...@google.com>
    Gerrit-Comment-Date: Wed, 12 Aug 2026 00:11:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Aug 11, 2026, 8:23:45 PM (7 hours ago) Aug 11
    to Antonio Ballesteros, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Joe Richey, David Chase, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Antonio Ballesteros and David Chase

    Ian Lance Taylor added 1 comment

    File src/cmd/cgo/out.go
    Line 798, Patchset 3 (Latest): fmt.Fprintf(fgcc, "\t(void)v;\n")
    Ian Lance Taylor . unresolved

    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.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Antonio Ballesteros
    • David Chase
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I99e535b10bf0ffd3f5e833b418767d625cb6f98d
    Gerrit-Change-Number: 813620
    Gerrit-PatchSet: 3
    Gerrit-Owner: Antonio Ballesteros <agb...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Joe Richey <joer...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Attention: Antonio Ballesteros <agb...@google.com>
    Gerrit-Comment-Date: Wed, 12 Aug 2026 00:23:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages