Skip to content

Commit 092668d

Browse files
runtime/testdata: fix for C23 nullptr keyword
Backport https://go.dev/cl/620955 from main repo. Original description: 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: I2e49fc87be16518215825f564bf5317eff4d4f3f Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/621059 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 6aa463f commit 092668d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libgo/go/runtime/testdata/testprogcgo/threadprof.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ __attribute__((constructor)) void issue9456() {
3636
}
3737
}
3838
39-
void **nullptr;
39+
void **nullpointer;
4040
4141
void *crash(void *p) {
42-
*nullptr = p;
42+
*nullpointer = p;
4343
return 0;
4444
}
4545

0 commit comments

Comments
 (0)