This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #ifndef SHARED in pthread.h


On Fri, Jun 1, 2012 at 1:57 PM, Roland McGrath <roland@hack.frob.com> wrote:
> I just noticed in nptl/sysdeps/pthread/pthread.h:
>
> ? ? ? ?/* Internal interface to initiate cleanup. ?*/
> ? ? ? ?extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
> ? ? ? ? ? ? __cleanup_fct_attribute __attribute__ ((__noreturn__))
> ? ? ? ?# ifndef SHARED
> ? ? ? ? ? ? __attribute__ ((__weak__))
> ? ? ? ?# endif
> ? ? ? ? ? ? ;
>
> This is using the internal macro SHARED in a public header, which is bad.
> This is inside the #else of:
>
> ? ? ? ?#if defined __GNUC__ && defined __EXCEPTIONS
>
> which I think will always be true when building libc itself.
>
> So perhaps this conditional should just go away?
>
> But I'm not really clear on all the details here.

Right, the use of SHARED is bad.

There is a hidden definition of __pthread_unwind_next in nptl/unwind.c.

Where would a second definition of __pthread_unwind_next come from?

Cheers,
Carlos.


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