Eli reported a failure in the detection code of iconv on MinGW while building groff:
configure:9176: checking for working iconv configure:9296: g++ -o conftest.exe -O0 -g3 -Id:/usr/include conftest.cpp d:/usr/lib/libiconv.dll.a -Ld:/usr/lib >&5 conftest.cpp: In function 'int main()': conftest.cpp:62:51: error: invalid conversion from 'char**' to 'const char**' [-fpermissive] In file included from conftest.cpp:43:0: d:\usr\bin\../lib/gcc/mingw32/4.7.2/../../../../include/iconv.h:83:15: error: initializing argument 2 of 'size_t libiconv(libiconv_t, const char**, size_t*, char**, size_t*)' [-fpermissive] conftest.cpp:82:51: error: invalid conversion from 'char**' to 'const char**' [-fpermissive] In file included from conftest.cpp:43:0: d:\usr\bin\../lib/gcc/mingw32/4.7.2/../../../../include/iconv.h:83:15: error: initializing argument 2 of 'size_t libiconv(libiconv_t, const char**, size_t*, char**, size_t*)' [-fpermissive] conftest.cpp:101:51: error: invalid conversion from 'char**' to 'const char**' [-fpermissive] In file included from conftest.cpp:43:0: d:\usr\bin\../lib/gcc/mingw32/4.7.2/../../../../include/iconv.h:83:15: error: initializing argument 2 of 'size_t libiconv(libiconv_t, const char**, size_t*, char**, size_t*)' [-fpermissive] configure:9296: $? = 1 configure: program exited with status 1 He writes: My libiconv is fairly old, and I'm reluctant to upgrade, because my MSYS/MinGW build environment is extremely stable and rock-solid, so I don't want to change it without a very good reason I solved this by using -fpermissive in GCC flags: CFLAGS='-O0 -g3' CXXFLAGS='-O0 -g3 -fpermissive' ./configure --prefix=d:/usr However, I wonder whether the configure script could also try a similar test program, but with 'const' dropped, if the one with 'const' failed. If not, I will use my work-around. It seems to me that the problem is a bug in gnulib's `iconv.m4' serialĀ 18 file: Looking into this file I see that the body of `AM_ICONV' calls the macro `AM_ICONV_LINK' before the test that checks whether `const' is needed. Obviously, it should be vice versa. Werner