diff mbox series

libgo: fix for C23 nullptr keyword

Message ID 5400ca56-94f0-44ce-39a2-f340135345d5@redhat.com
State New
Headers show
Series libgo: fix for C23 nullptr keyword | expand

Commit Message

Joseph Myers Oct. 17, 2024, 8:15 p.m. UTC
Making GCC default to -std=gnu23 for C code produces Go test failures 
because of C code used by Go that uses a variable called nullptr, which is 
a keyword in C23.

I've submitted this fix upstream at 
https://github.com/golang/go/pull/69927 using the GitHub mirror workflow.  
Ian, once some form of such a fix is upstream, could you backport it to 
GCC's libgo?
diff mbox series

Patch

diff --git a/libgo/go/runtime/testdata/testprogcgo/threadprof.go b/libgo/go/runtime/testdata/testprogcgo/threadprof.go
index d62d4b4be83..f61c51b8b62 100644
--- a/libgo/go/runtime/testdata/testprogcgo/threadprof.go
+++ b/libgo/go/runtime/testdata/testprogcgo/threadprof.go
@@ -36,10 +36,10 @@  __attribute__((constructor)) void issue9456() {
 	}
 }
 
-void **nullptr;
+void **nullpointer;
 
 void *crash(void *p) {
-	*nullptr = p;
+	*nullpointer = p;
 	return 0;
 }