[xml] patch for warning on solaris



Hi all,

I noticed a compilation warning coming from encoding.c, which happens
because the native (not GNU) iconv on solaris (sensibly) takes a const char **
rather than a char ** as input.

Here's a patch, but it's not complete as you'd need to check that solaris 
iconv is being used, not just that the platform is solaris.

--- old/encoding.c     Fri Aug 15 09:32:58 2003
+++ new/encoding.c      Mon Oct  6 11:27:03 2003
@@ -2014,5 +2014,9 @@
     int ret;
                                                                                
+#if (defined(sun) || defined(__sun__)) && (defined __svr4__ || defined(__SVR4))
+    ret = iconv(cd, &icv_in, &icv_inlen, &icv_out, &icv_outlen);
+#else
     ret = iconv(cd, (char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
+#endif
     if (in != NULL) {
         *inlen -= icv_inlen;

PS - does anyone know why GNU iconv has the input as a pointer to
pointer to non-const char?

cheers,

Graham.

-- 
Graham Bennett



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]