Skip to content

Commit 4b6cbc3

Browse files
committed
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. Change-Id: Icfa943f293f6eac8f41d0615da40c126330d7d11 Reviewed-on: https://go-review.googlesource.com/c/go/+/692877 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent b2960e3 commit 4b6cbc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/cgo/internal/test/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void *thread(void *p) {
245245
return NULL;
246246
}
247247
void testSendSIG() {
248-
const int N = 20;
248+
enum { N = 20 };
249249
int i;
250250
pthread_t tid[N];
251251
for (i = 0; i < N; i++) {

0 commit comments

Comments
 (0)