Subject: | Passing argument 2 of 'iconv' from incompatible pointer type |
I noticed a compiler warning:
gcc -c -Iinclude -Iinclude/generic -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I
/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pa
ngo-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/libpng16 -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -DVERSION=\"1.43\" -DXS_VERSION=\"1.43\" -fPIC "-I/usr/lib64/perl5/CORE" unix/xft.c -o unix/xft.o
unix/xft.c: In function 'prima_xft_init':
unix/xft.c:232:31: warning: passing argument 2 of 'iconv' from incompatible pointer type [-Wincompatible-pointer-types]
int ret = iconv( ii, ( const char **) &iptr, &ibl, ( char **) &optr, &obl);
^
In file included from unix/xft.c:82:0:
/usr/include/iconv.h:42:15: note: expected 'char ** restrict' but argument is of type 'const char **'
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
^
Indeed POSIX declares the type without const (char **restrict).