PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
Jason Merrill
jason_merrill@redhat.com
Wed Jun 6 04:44:00 GMT 2001
>>>>> "Loren" == Loren James Rittle <rittle@latour.rsch.comm.mot.com> writes:
> In article < m3g0dfi5hx.fsf@prospero.cambridge.redhat.com > you write:
>> Shouldn't those all be void (*)(), not void *?
>>> ! static void *__gthread_active_ptr = (void *) &pthread_create;
> I don't think so. No function calls are ever made through
> __gthread_active_ptr.
It's still wrong to use a pointer to data type to refer to a function.
> In other implementations of the gthr.h interface (e.g. win32),
> __gthread_active_ptr might map to a symbol known to exist in the
> threaded C library with value 1 and exist in the non-threaded C
> library with a value 0.
> Why it is type (void*) instead of int is unknown to me.
Perhaps it should be
static int __gthread_active_ptr = !! &pthread_create;
then?
Jason
More information about the Libstdc++
mailing list