https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125956
--- Comment #6 from William Root <william.root1996 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #5)
> Libstdc++ already has this workaround elsewhere, so we should do the same in
> format.cc:
>
> // This adaptor works around the signature problems of the second
> // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
> // uses 'char**', which matches the POSIX 1003.1-2001 standard.
> // Using this adaptor, g++ will do the work for us.
> template<typename _Tp>
> inline size_t
> __iconv_adaptor(size_t(*__func)(iconv_t, _Tp, size_t*, char**, size_t*),
> iconv_t __cd, char** __inbuf, size_t* __inbytes,
> char** __outbuf, size_t* __outbytes)
> { return __func(__cd, (_Tp)__inbuf, __inbytes, __outbuf, __outbytes); }
Thank you for providing a better workaround! How would I go about applying it?