From 5926f30a8dcee9142360fdae445ebfdee4a528f9 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 13 Jul 2022 18:17:30 +0200
Subject: [PATCH] GCN: Address undeclared 'NULL' usage in
'libgcc/config/gcn/gthr-gcn.h:__gthread_getspecific'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For 'libgcc/config/gcn/gthr-gcn.h' used in libstdc++ context (WIP), we have:
[...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libstdc++-v3/include/amdgcn-amdhsa/bits/gthr-default.h: In function ‘void* __gthread_getspecific(__gthread_key_t)’:
[...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libstdc++-v3/include/amdgcn-amdhsa/bits/gthr-default.h:90:10: error: ‘NULL’ was not declared in this scope
90 | return NULL;
| ^~~~
Resolve this with 's%NULL%0', as is used in
'libgcc/gthr-single.h:__gthread_getspecific', for example.
Follow-up to commit 76d463310787c8c7fd0c55cf88031b240311ab68
"Create GCN-specific gthreads".
libgcc/
* config/gcn/gthr-gcn.h (__gthread_getspecific): 's%NULL%0'.
---
libgcc/config/gcn/gthr-gcn.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -87,7 +87,7 @@ __gthread_key_delete (__gthread_key_t __key __attribute__ ((__unused__)))
static inline void *
__gthread_getspecific (__gthread_key_t __key __attribute__((unused)))
{
- return NULL;
+ return 0;
}
static inline int
--
2.34.1