crypto/threads_pthread.c:48:5: warning: implicit declaration of function ‘pthread_mutexattr_settype’

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

crypto/threads_pthread.c:48:5: warning: implicit declaration of function ‘pthread_mutexattr_settype’

OpenSSL - User mailing list

This is a strange error to get on Debian sid amd64 :


/usr/bin/gcc-10  -I. -Iinclude -fPIC -pthread -std=iso9899:1999 -m64 -g
-O0 -march=k8 -mtune=k8 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags
-fno-builtin -malign-double -mpc80 -std=iso9899:1999 -m64 -g -O0
-march=k8 -mtune=k8 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags
-fno-builtin -malign-double -mpc80 -DOPENSSL_USE_NODELETE -DL_ENDIAN
-DOPENSSL_PIC -DOPENSSLDIR="\"/opt/bw/ssl\""
-DENGINESDIR="\"/opt/bw/lib/engines-1.1\""  -I/opt/bw/include -MMD -MF
crypto/threads_pthread.d.tmp -MT crypto/threads_pthread.o -c -o
crypto/threads_pthread.o crypto/threads_pthread.c
crypto/threads_pthread.c: In function ‘CRYPTO_THREAD_lock_new’:
crypto/threads_pthread.c:48:5: warning: implicit declaration of function
‘pthread_mutexattr_settype’; did you mean ‘pthread_mutexattr_destroy’?
[-Wimplicit-function-declaration]
   48 |     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |     pthread_mutexattr_destroy
crypto/threads_pthread.c:48:38: error: ‘PTHREAD_MUTEX_RECURSIVE’
undeclared (first use in this function); did you mean
‘PTHREAD_MUTEX_RECURSIVE_NP’?
   48 |     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~
      |                                      PTHREAD_MUTEX_RECURSIVE_NP
crypto/threads_pthread.c:48:38: note: each undeclared identifier is
reported only once for each function it appears in
make[1]: *** [Makefile:5104: crypto/threads_pthread.o] Error 1
make[1]: Leaving directory
'/opt/bw/build/openssl-1.1.1h_debian_sid_5.8.0-2-amd64.004'
make: *** [Makefile:174: all] Error 2
Command exited with non-zero status 2


Why should the include of pthread.h be absent here ?

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional