In iconv/iconv.h the definition of iconv is: extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft); which is wrong. The second argument should be "const char **__restrict __inbuf". This has been fixed for sometime now in the libiconv project http://libiconv.cvs.sourceforge.net/*checkout*/libiconv/libiconv/include/iconv.h.in but not in glibc, which makes it hard to write code which is correct for both. I checked for this bug against the glibc CVS on 21 Feb 2007
*** This bug has been marked as a duplicate of 2962 ***