]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: error on multiple incompatible function declarations
authorKeith Randall <khr@golang.org>
Thu, 30 May 2024 02:37:43 +0000 (19:37 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 23 Jul 2024 21:11:11 +0000 (21:11 +0000)
commitdf009eead9c2d213bc9c6057f07d2c319f71b50b
treed2c1299bc4f68e3735bc40bacede80ee2f570a0f
parentb0f7be3cfa1ee5fbfe46590475861677cc9514fa
cmd/cgo: error on multiple incompatible function declarations

When there are multiple declarations of a function, ensure that
those declarations at least agree on the size/alignment of arguments
and return values.

It's hard to be stricter given existing code and situations where
arguments differ only by typedefs. For instance:
    int usleep(unsigned);
    int usleep(useconds_t);

Fixes #67699.

Change-Id: I3b4b17afee92b55f9e712b4590ec608ab1f7ac91
Reviewed-on: https://go-review.googlesource.com/c/go/+/588977
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
doc/next/3-tools.md
src/cmd/cgo/internal/testerrors/errors_test.go
src/cmd/cgo/internal/testerrors/testdata/issue67699a.go [new file with mode: 0644]
src/cmd/cgo/internal/testerrors/testdata/issue67699b.go [new file with mode: 0644]
src/cmd/cgo/main.go