On Fri, Apr 09, 2021 at 10:28:47AM -0600, Martin Sebor wrote:
> > pthread_setspecific second argument is const void *, so that one can
> > call it even with pointers to const, but the function only stores the
> > pointer and does nothing else, so the new assumption of 
> > -Wmaybe-uninitialized
> > that functions taking such pointers will read from what those pointers
> > will point to is wrong.  Maybe it would be useful to have some whitelist
> > of functions that surely don't do that.
> 
> The intended mechanism to suppress the warning in these cases is
> attribute access:  adding __attribute__ ((access (none, 2))) to
> pthread_setspecific() avoids the warning.  I opened a Glibc bug
> to do that:
> 
>   https://sourceware.org/bugzilla/show_bug.cgi?id=27714

While that is nice, the bugreport wasn't about glibc (where one has TLS and
so doesn't run into it), but uclibc.

        Jakub

Reply via email to