runtime/testdata: fix for C23 nullptr keyword

src/runtime/testdata/testprogcgo/threadprof.go contains C code with a
variable called nullptr.  This conflicts with the nullptr keyword in
the C23 revision of the C standard (showing up as gccgo test build
failures when updating GCC to use C23 by default when building C
code).

Rename that variable to nullpointer to avoid the clash with the
keyword (any other name that's not a keyword would work just as well).

Change-Id: Ida5ef371a3f856c611409884e185c3d5ded8e86c
GitHub-Last-Rev: 2ec464703b
GitHub-Pull-Request: golang/go#69927
Reviewed-on: https://go-review.googlesource.com/c/go/+/620955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Joseph Myers 2024-10-17 20:30:37 +00:00 committed by Gopher Robot
parent cd4820cd19
commit 04f054d334
1 changed files with 2 additions and 2 deletions

View File

@ -36,10 +36,10 @@ __attribute__((constructor)) void issue9456() {
}
}
void **nullptr;
void **nullpointer;
void *crash(void *p) {
*nullptr = p;
*nullpointer = p;
return 0;
}