]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GCN: Address undeclared 'NULL' usage in 'libgcc/config/gcn/gthr-gcn.h:__gthread_getsp...
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 13 Jul 2022 16:17:30 +0000 (18:17 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Nov 2023 14:49:27 +0000 (15:49 +0100)
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

index a0bfde2023aa1128fcdaf562601d1dc04193993c..d81b27db933ae932cc26a578fa2faece3d25e5ef 100644 (file)
@@ -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