On Thu, Dec 25, 2014 at 5:58 PM, Eli Zaretskii <[email protected]> wrote: >> All the documentation I have looked at for "iconv" doesn't show >> "const" for any of the arguments. > > I have in my include/iconv.h: > > #ifndef LIBICONV_PLUG > #define iconv libiconv > #endif > extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, > char* * outbuf, size_t *outbytesleft); > > Here are the warnings I get: > > info-utils.c: In function 'copy_converting': > info-utils.c:915:30: warning: passing argument 2 of 'libiconv' from > incompatible pointer type [enabled by default] > In file included from info-utils.h:30:0, > from info-utils.c:24: > d:\usr\bin\../lib/gcc/mingw32/4.7.2/../../../../include/iconv.h:83:15: > note: expected 'const char **' but argument is of type 'char **' > > info-utils.c: In function 'text_buffer_iconv': > info-utils.c:1969:22: warning: passing argument 2 of 'libiconv' from > incompatible pointer type [enabled by default] > In file included from info-utils.h:30:0, > from info-utils.c:24: > d:\usr\bin\../lib/gcc/mingw32/4.7.2/../../../../include/iconv.h:83:15: > note: expected 'const char **' but argument is of type 'char **' > This appears to be an issue with varying implementations/standards. Later standards declare the parameter as a 'char **', presumably because char ** doesn't convert to const char **. We could always stick a cast in there if the warning is a problem.
References: http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html https://sourceware.org/bugzilla/show_bug.cgi?id=2962
