[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
iconv.m4: recognize Solaris bug
From: |
Bruno Haible |
Subject: |
iconv.m4: recognize Solaris bug |
Date: |
Fri, 1 Jan 2010 01:57:23 +0100 |
User-agent: |
KMail/1.9.9 |
The test-striconveh.c test was extended on 2009-09-05 to test also the
conversion from ASCII to ISO-8859-1 with invalid input. This test fails
on Solaris 8, 9, 10 with the native (non-GNU) Solaris iconv because it
is not able to report invalid input at least in this case.
This fixes it by undefining HAVE_ICONV in this configuration.
2010-01-01 Bruno Haible <address@hidden>
iconv: Reject native Solaris iconv.
* m4/iconv.m4 (AM_ICONV_LINK): Recognize native Solaris iconv() bug.
* doc/posix-functions/iconv.texi: Document native Solaris iconv() bug.
--- doc/posix-functions/iconv.texi.orig Fri Jan 1 01:53:41 2010
+++ doc/posix-functions/iconv.texi Fri Jan 1 01:33:55 2010
@@ -12,7 +12,7 @@
GNU libiconv is not found if installed in @file{$PREFIX/lib}.
@item
Failures are not distinguishable from successful returns on some platforms:
-AIX 5.1.
+AIX 5.1, Solaris 10.
@end itemize
Portability problems not fixed by Gnulib:
--- m4/iconv.m4.orig Fri Jan 1 01:53:41 2010
+++ m4/iconv.m4 Fri Jan 1 01:38:09 2010
@@ -1,5 +1,5 @@
-# iconv.m4 serial AM8 (gettext-0.18)
-dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
+# iconv.m4 serial 9 (gettext-0.18)
+dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -58,7 +58,7 @@
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
- dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
+ dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
@@ -87,6 +87,25 @@
return 1;
}
}
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\263";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
#if 0 /* This bug could be worked around by the caller. */
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- iconv.m4: recognize Solaris bug,
Bruno Haible <=