Hello,
I'm trying to compile openmpi - 1-19a + r28134 with a newly compiled
mingw-w64 toolchain, based on:
binutils 2.23
gcc-4.8-20130217
mingw-crt and headers from svn rev 5615
experimental winpthread from svn rev 5501
The configure script fails to detect pthreads due to an error when
trying to compile the code
| #include <pthread.h>
| int
| main ()
| {
| pthread_t th=pthread_self(); pthread_join(th, 0);
| pthread_attr_init(0); pthread_cleanup_push(0, 0);
| pthread_create(0,0,0,0); pthread_cleanup_pop(0);
| ;
| return 0;
| }
the reported build error is
conftest.cpp: In function 'int main()':
error: second operand to the conditional operator is of type 'void', but
the third operand is neither a throw-expression nor of type 'void'
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
^
Is this just a missue of the macro due to the configure script or a
misstake in the implementation of the macro?
Note: in pthreads library pthread.h header, this macro is defined in
terms of
#define pthread_cleanup_pop( _execute ) \
} \
__finally \
{ \
if( _execute || AbnormalTermination()) \
{ \
(*(_cleanup.routine))( _cleanup.arg ); \
} \
} \
}
when it is defined in winpthread pthread.h in terms of
#define pthread_cleanup_pop(E)\
(*pthread_getclean() = _pthread_cup.next,
(E?_pthread_cup.func((pthread_once_t *)_pthread_cup.arg):0));}
maybe would it be better to define it in term like
#define pthread_cleanup_pop(E)\
*pthread_getclean() = _pthread_cup.next; \
if(E) \
_pthread_cup.func((pthread_once_t *)_pthread_cup.arg);
in order to deal with (possible) missuse?
Any suggestion about this?
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public