CXX on X86 : the wrong pthread_join is picked up

Locked

Topic author
joukj
Master
Posts: 179
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

CXX on X86 : the wrong pthread_join is picked up

Post by joukj » Wed Jun 28, 2023 2:47 am

Hi all,

Sometimes the wrong pthread_join is picked from the pthread.h include file. This is because __INITIAL_POINTER_SIZE is not defined if the /pointer qualifier is not present. See the following example:

Code: Select all

rumba-jj) cxx/vers
clang version 10.0.1 (git@bitbucket.org:vms_software/llvm-10.0.1.git d469fd71c59
f33c7d998debe420a69abb31f1f57)
Build date: 06-16-2023
Target: x86_64-OpenVMS
Thread model: posix
InstalledDir: RUMBA$DKA100:[SYS0.SYSCOMMON.][SYSEXE]
rumba-jj) ty test.cxx
#include <pthread.h>
int main()
{
   pthread_t id;
   void** num;
   int i;

   i = pthread_join( id , num );

}
  28-JUN-2023 08:46:46
rumba-jj) cxx test.cxx
$DISK6:[JOUKJ.test]test.cxx;39:8:8: error: no matching function for call to 'pth
read_join32'
   i = pthread_join( id , num );
       ^~~~~~~~~~~~
/SYS$COMMON/VSICXX$LIB/INCLUDE/SYS$STARLET_C/pthread.h:1641:24: note: expanded f
rom macro 'pthread_join'
#  define pthread_join pthread_join32
                       ^~~~~~~~~~~~~~
/SYS$COMMON/VSICXX$LIB/INCLUDE/SYS$STARLET_C/pthread.h:1634:12: note: candidate 
function not viable: no known conversion from 'void **' to '__pthreadShortAddr_t
 *' (aka '__sptr __ptr32 void **') for 2nd argument
extern int pthread_join32 (pthread_t, __pthreadShortAddr_t*);
           ^
1 error generated.
rumba-jj) cxx/point=64 test.cxx
rumba-jj)


jreagan
VSI Expert
Master
Posts: 141
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: CXX on X86 : the wrong pthread_join is picked up

Post by jreagan » Wed Jun 28, 2023 9:51 am

Thanks. I'll pass it along.


Topic author
joukj
Master
Posts: 179
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

Re: CXX on X86 : the wrong pthread_join is picked up

Post by joukj » Tue Jul 25, 2023 4:18 am

Looks like this one is solved in the C++compiler released yesterday

Locked