mirror of
https://github.com/golang/go.git
synced 2026-02-07 03:15:05 +03:00
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user