]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/testdata: fix for C23 nullptr keyword
authorJoseph Myers <josmyers@redhat.com>
Thu, 17 Oct 2024 20:30:37 +0000 (20:30 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 18 Oct 2024 22:35:39 +0000 (22:35 +0000)
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: 2ec464703be0507a67a077741789a37511d197e4
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>
src/runtime/testdata/testprogcgo/threadprof.go

index 00b511d23be6092d2fe6b4b03ed74262b4d89911..2d8c0f6d90002e231233323bcdc36ce4d01131de 100644 (file)
@@ -36,10 +36,10 @@ __attribute__((constructor)) void issue9456() {
        }
 }
 
-void **nullptr;
+void **nullpointer;
 
 void *crash(void *p) {
-       *nullptr = p;
+       *nullpointer = p;
        return 0;
 }