Hello,

current implementaion of pthread_cleanup_pop does not compile under gcc
5.3.0.

See line 214 in pthread.h (
https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-libraries/winpthreads/include/pthread.h
):

#define pthread_cleanup_pop(E)\
    (*pthread_getclean() = _pthread_cup.next,
(E?_pthread_cup.func((pthread_once_t *)_pthread_cup.arg):0));}

Calling "pthread_cleanup_pop(1);" produces the following error message:

error: second operand to the conditional operator is of type 'void', but
the third operand is neither a throw-expression nor of type 'void'

Rewriting the macro definition without the ternary conditional operator as
follows helps:

#define pthread_cleanup_pop(E)\
    {*pthread_getclean() = _pthread_cup.next; if (E)
_pthread_cup.func((pthread_once_t *)_pthread_cup.arg);}}

Would it be possible to fix this in mingw-w64 so that we don't need to hack
pthread.h like this?

Thanks.

Best regards,
Ondra Tethal
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to