* Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
[not found] ` <200106051514.f55FE5V17145@latour.rsch.comm.mot.com>
@ 2001-06-06 4:44 ` Jason Merrill
2001-06-06 13:54 ` Loren James Rittle
2001-06-07 14:40 ` Richard Henderson
0 siblings, 2 replies; 5+ messages in thread
From: Jason Merrill @ 2001-06-06 4:44 UTC (permalink / raw)
To: Loren James Rittle; +Cc: libstdc++, gcc
>>>>> "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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
2001-06-06 4:44 ` PATCH: Allow gcc/gthr* to be compiled by C++ as well as C Jason Merrill
@ 2001-06-06 13:54 ` Loren James Rittle
2001-06-06 16:33 ` Jason Merrill
2001-06-07 14:40 ` Richard Henderson
1 sibling, 1 reply; 5+ messages in thread
From: Loren James Rittle @ 2001-06-06 13:54 UTC (permalink / raw)
To: jason_merrill; +Cc: libstdc++, gcc
>> Why it is type (void*) instead of int is unknown to me.
> Perhaps it should be
> static int __gthread_active_ptr = !! &pthread_create;
> then?
No disagreement from me. However, changing the type of
__gthread_active_ptr is an ABI change instead of a mere bug fix to
allow C++ compilation of the header...
I am wiling to do more clean up on those files since I understand
them, but I didn't want to radically change anything.
Regards,
Loren
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
2001-06-06 13:54 ` Loren James Rittle
@ 2001-06-06 16:33 ` Jason Merrill
0 siblings, 0 replies; 5+ messages in thread
From: Jason Merrill @ 2001-06-06 16:33 UTC (permalink / raw)
To: rittle; +Cc: libstdc++, gcc
>>>>> "Loren" == Loren James Rittle <rittle@latour.rsch.comm.mot.com> writes:
>>> Why it is type (void*) instead of int is unknown to me.
>> Perhaps it should be
>> static int __gthread_active_ptr = !! &pthread_create;
>> then?
> No disagreement from me. However, changing the type of
> __gthread_active_ptr is an ABI change instead of a mere bug fix to
> allow C++ compilation of the header...
I suppose so. Well,
(void *) !! &pthread_create
would still be more correct...
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
2001-06-06 4:44 ` PATCH: Allow gcc/gthr* to be compiled by C++ as well as C Jason Merrill
2001-06-06 13:54 ` Loren James Rittle
@ 2001-06-07 14:40 ` Richard Henderson
2001-06-08 3:59 ` Jason Merrill
1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2001-06-07 14:40 UTC (permalink / raw)
To: Jason Merrill; +Cc: Loren James Rittle, libstdc++, gcc
On Wed, Jun 06, 2001 at 12:43:20PM +0100, Jason Merrill wrote:
> Perhaps it should be
>
> static int __gthread_active_ptr = !! &pthread_create;
>
> then?
That isn't valid C. This file must be usable by both C and C++.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
2001-06-07 14:40 ` Richard Henderson
@ 2001-06-08 3:59 ` Jason Merrill
0 siblings, 0 replies; 5+ messages in thread
From: Jason Merrill @ 2001-06-08 3:59 UTC (permalink / raw)
To: Richard Henderson; +Cc: Loren James Rittle, libstdc++, gcc
>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
> On Wed, Jun 06, 2001 at 12:43:20PM +0100, Jason Merrill wrote:
>> Perhaps it should be
>>
>> static int __gthread_active_ptr = !! &pthread_create;
>>
>> then?
> That isn't valid C. This file must be usable by both C and C++.
Good point. OK, never mind...
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-06-08 3:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200105301345.f4UDjuo32030@latour.rsch.comm.mot.com>
[not found] ` <200106051514.f55FE5V17145@latour.rsch.comm.mot.com>
2001-06-06 4:44 ` PATCH: Allow gcc/gthr* to be compiled by C++ as well as C Jason Merrill
2001-06-06 13:54 ` Loren James Rittle
2001-06-06 16:33 ` Jason Merrill
2001-06-07 14:40 ` Richard Henderson
2001-06-08 3:59 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).