Issue 8620 - GCC error undeclared PTHREAD_MUTEX_ROBUST
Summary: GCC error undeclared PTHREAD_MUTEX_ROBUST
Status: UNCONFIRMED
Alias: None
Product: LMDB
Classification: Unclassified
Component: liblmdb (show other issues)
Version: 0.9.20
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-18 03:01 UTC by blissend@gmail.com
Modified: 2020-03-23 03:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description blissend@gmail.com 2017-03-18 03:01:21 UTC
Full_Name: Adam Carlin
Version: lmdb 0.9.20
OS: Windows 10
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (108.27.217.230)


I'm using Windows 10 with msys2 64bit (http://www.msys2.org/) which utilizes
mingw-w64. When I compile lmdb (https://github.com/LMDB/lmdb/tree/mdb.RE/0.9)
v0.9.20 it spits out the error message below...

blissend@shockedloris MSYS /c/Compile/lmdb/libraries/liblmdb
$ make
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast
-Wuninitialized   -c mdb.c
mdb.c: In function �mdb_env_setup_locks�:
mdb.c:4853:17: warning: implicit declaration of function
�pthread_mutexattr_setrobust� [-Wimplicit-function-declaration]
   if (!rc) rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mdb.c:4853:53: error: �PTHREAD_MUTEX_ROBUST� undeclared (first use in this
function)
   if (!rc) rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST);
                                                     ^~~~~~~~~~~~~~~~~~~~
mdb.c:4853:53: note: each undeclared identifier is reported only once for each
function it appears in
mdb.c: In function �mdb_mutex_failed�:
mdb.c:362:37: warning: implicit declaration of function
�pthread_mutex_consistent� [-Wimplicit-function-declaration]
 #define mdb_mutex_consistent(mutex) pthread_mutex_consistent(mutex)
                                     ^
mdb.c:10220:10: note: in expansion of macro �mdb_mutex_consistent�
    rc2 = mdb_mutex_consistent(mutex);
          ^~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:83: mdb.o] Error 1

Anyway to fix this? If this helps, I've noticed that line 4853 for above error
has an if check for MDB_ROBUST_SUPPORTED which gets defined on line 278. However
the missing declaration of pthread_mutexattr_setrobust is in another if check
above line 278.
Comment 1 blissend@gmail.com 2017-03-18 03:39:26 UTC
Ahah, it compiles if you remove lines 277-279 which was...

#if defined(MDB_OWNERDEAD) && (MDB_USE_ROBUST)
#define MDB_ROBUST_SUPPORTED 1
#endif

However, I'm not sure that's what one should do.
Comment 2 Quanah Gibson-Mount 2017-03-20 23:32:18 UTC
moved from Incoming to Software Bugs