This is the mail archive of the
mailing list for the libstdc++ project.
Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Subject: Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 06 Jun 2001 12:43:20 +0100
- Cc: libstdc++ at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <200105301345.f4UDjuo32030@latour.rsch.comm.mot.com><200106051514.f55FE5V17145@latour.rsch.comm.mot.com>
>>>>> "Loren" == Loren James Rittle <firstname.lastname@example.org> writes:
> In article <email@example.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
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;