This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: #ifndef SHARED in pthread.h
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 2 Jun 2012 13:25:32 -0400
- Subject: Re: #ifndef SHARED in pthread.h
- References: <20120601175704.682D82C0A1@topped-with-meat.com>
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.