From: Bruno Haible Date: Wed, 24 Jan 2001 13:58:23 +0000 (+0000) Subject: Avoid gcc warning caused by the use of iconv(). X-Git-Tag: v0.10.36~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1fca34e753fcf785b7215ee82d7a3fc2c6b0576;p=thirdparty%2Fgettext.git Avoid gcc warning caused by the use of iconv(). --- diff --git a/intl/ChangeLog b/intl/ChangeLog index c2ef102fa..581b8d47b 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,8 @@ +2001-01-15 Bruno Haible + + * dcigettext.c (_nl_find_msg): Cast the second iconv() arg, to avoid + a warning. + 2001-01-07 Bruno Haible * gettextP.h (__gettextdebug): Remove declaration. diff --git a/intl/dcigettext.c b/intl/dcigettext.c index c9e52a7e8..fc1716e42 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -821,7 +821,9 @@ _nl_find_msg (domain_file, msgid, lengthp) goto resize_freemem; outleft = freemem_size - sizeof (size_t); - if (iconv (domain->conv, &inptr, &inleft, &outptr, &outleft) + if (iconv (domain->conv, + (ICONV_CONST char **) &inptr, &inleft, + &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; diff --git a/m4/ChangeLog b/m4/ChangeLog index 4af3df579..378f903b4 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,13 @@ +2001-01-20 Bruno Haible + + * gettext.m4 (AM_WITH_NLS): Add a third argument to AC_DEFINE. + * lcmessage.m4 (AM_LC_MESSAGES): Likewise. + +2001-01-15 Bruno Haible + + * iconv.m4 (AM_ICONV): Also check whether the iconv declaration + has const. + 2001-01-07 Bruno Haible * gettext.m4 (AM_WITH_NLS): Remove third argument. Don't call diff --git a/m4/iconv.m4 b/m4/iconv.m4 index a23a320c9..eb9f765d6 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -30,6 +30,27 @@ AC_DEFUN(AM_ICONV, ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then