This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Fix weak handling with GCC 3.4+
- From: Richard Henderson <rth at twiddle dot net>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: Andreas Jaeger <aj at suse dot de>, libc-alpha at sources dot redhat dot com
- Date: Fri, 3 Jan 2003 14:41:23 -0800
- Subject: Re: Fix weak handling with GCC 3.4+
- References: <u84r8qtski.fsf@gromit.moeb> <3E16100A.4070406@redhat.com>
On Fri, Jan 03, 2003 at 02:34:50PM -0800, Ulrich Drepper wrote:
> __thread int foo = 0;
> extern __typeof (foo) foo __attribute ((weak));
>
>
> __typeof() apparently does not include the __thread information. I'd
> call it a gcc bug.
Why do you say that? __thread is a storage class specifier, not a
type specifier. It would be just as incorrect if __typeof somehow
copied "static" or "extern".
IMO this idiom is simply incorrect wrt __thread.
It would work if you used
extern __thread __typeof(foo) foo __attribute((weak));
or just
#pragma weak foo
r~