[PATCH] Make the pointer parameter to __gthread_setspecific non-const

Richard Guenther richard.guenther@gmail.com
Sat Aug 23 18:48:00 GMT 2008


On Sat, Aug 23, 2008 at 7:14 PM, Aaron W. LaFramboise
<aaronavay62@aaronwl.com> wrote:
> Currently on i386-pc-mingw32, casting away constness in
> __gthread_setspecific causes a bootstrap failure with --enable-werror. This
> must be true for a number of other targets which do the same thing.
>
> The ultimate problem here is that there's nothing about this parameter that
> is const: __gthread_getspecific returns a non-const pointer, not a const
> one.
>
> This patch fixes this situation by making this parameter non-const in all
> instances of __gthread_setspecific.
>
> I tested this by bootstrapping on i686-pc-linux and i386-pc-mingw32.
>
> OK to commit?

But pthread_setspecific _does_ take a constant pointer as argument.  Why
not add an explicit cast for the mingw32 case?

Richard.



More information about the Gcc-patches mailing list