This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: Aliases ...


> Roland McGrath <roland@redhat.com> writes:
> 
> >> Here's a patch to initialize it - it removes the warning.
> >
> > This really happens with __thread?  The right thing when this issue comes
> > up is to use __attribute__((nocommon)).
> 
> 
> This test case does indeed warn:
> 
>  __thread int errno __attribute__ ((nocommon));
> extern __thread int __libc_errno __attribute__ ((alias ("errno")));
> 
> with:
> test.i:2: warning: $,1rx(B__libc_errno$,1ry(B aliased to undefined symbol $,1rx(Berrno$,1ry
(B> 
> Initialising it to 0 fixes it,

Of course __attribute__ ((nocommon)) isn't meaningful with __thread.
__thread variables are never commons.  The question is why there is a
warning in the first place here.  AFAIK, there is no problem with an
uninitialized __thread variable getting an alias, except in the compiler's
mind.  


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