This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]