To compile Pan on NetBSD, I have to apply the patch below. The signature of the iconv() function apparently differs between NetBSD and Linux.
The 2nd argument needs to be a (const char **) on NetBSD, which it already is without the cast that is in the source. With the cast, gcc complains and terminates compilation. It may even be better to put a check in configure for this. $NetBSD: patch-pan_usenet-utils_mime-utils.cc,v 1.2 2012/07/13 08:16:00 marino Exp $ Fix build with NetBSD's iconv(). --- pan/usenet-utils/mime-utils.cc.orig 2012-06-29 22:24:54.000000000 +0000 +++ pan/usenet-utils/mime-utils.cc @@ -77,7 +77,11 @@ namespace pan outbuf = out + converted; outleft = outlen - converted; +#if defined(__NetBSD__) + converted = iconv (cd, &inbuf, &inleft, &outbuf, &outleft); +#else converted = iconv (cd, (char **) &inbuf, &inleft, &outbuf, &outleft); +#endif if (converted != (size_t) -1 && errno == 0) { /* [ as an aside: Manual pages from NetBSD give this function signature: size_t iconv(iconv_t cd, const char ** restrict src, size_t * restrict srcleft, char ** restrict dst, size_t * restrict dstleft); On Linux it is this: size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); Both claim to conform to POSIX.1. They can't both be right, if there is such a big difference between the types that the compiler terminates on a cast between them. Most online manual pages for iconv seem to be Linux manpages, but http://pubs.opengroup.org/onlinepubs/007908799/xsh/iconv.html seems to give the answer, being from The Open Group itself. ] -Olaf. -- ___ Olaf 'Rhialto' Seibert -- There's no point being grown-up if you \X/ rhialto/at/xs4all.nl -- can't be childish sometimes. -The 4th Doctor _______________________________________________ Pan-users mailing list Pan-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/pan-users