aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-08-02 18:13:19 -0400
committerGopher Robot <gobot@golang.org>2026-03-11 09:38:09 -0700
commitde86eaeb0f53be6d0a1a22aeba5624e5aaf20364 (patch)
tree0407d3d2f91ef0ba156e5a7e679da827b511f0d7
parent439ff996f0ee506fc2eb84b7f11ffc360a6299f2 (diff)
downloadgo-de86eaeb0f53be6d0a1a22aeba5624e5aaf20364.tar.xz
[release-branch.go1.25] cmd/cgo/internal/test: use (syntactic) constant for C array bound
A test in C has an array bound defined as a "const int", which is technically a variable. The new version of C compiler in Xcode 26 beta emits a warning "variable length array folded to constant array as an extension" for this (as an error since we build the test with -Werror). Work around this by using an enum, which is syntactically a constant. For #77998. Fixes #77999. Change-Id: Icfa943f293f6eac8f41d0615da40c126330d7d11 Reviewed-on: https://go-review.googlesource.com/c/go/+/692877 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Cq-Include-Trybots: luci.golang.try:go1.25-darwin-arm64_26 (cherry picked from commit 4b6cbc377f9b3d2598b0d30a37c9cf3797ba6e12) Reviewed-on: https://go-review.googlesource.com/c/go/+/752520 TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
-rw-r--r--src/cmd/cgo/internal/test/test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/cgo/internal/test/test.go b/src/cmd/cgo/internal/test/test.go
index 844b2dd42c..fb4a8250a2 100644
--- a/src/cmd/cgo/internal/test/test.go
+++ b/src/cmd/cgo/internal/test/test.go
@@ -245,7 +245,7 @@ static void *thread(void *p) {
return NULL;
}
void testSendSIG() {
- const int N = 20;
+ enum { N = 20 };
int i;
pthread_t tid[N];
for (i = 0; i < N; i++) {