changeset 11225:24c0bc8164ae

Detect bug in cygwin 1.5.x *printf on 1-character %ls. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_LS): Enhance filter. * doc/posix-functions/fprintf.texi: Update. * doc/posix-functions/printf.texi: Update. * doc/posix-functions/snprintf.texi: Update. * doc/posix-functions/sprintf.texi: Update. * doc/posix-functions/vfprintf.texi: Update. * doc/posix-functions/vprintf.texi: Update. * doc/posix-functions/vsnprintf.texi: Update. * doc/posix-functions/vsprintf.texi: Update. * doc/glibc-functions/obstack_printf.texi: Update. * doc/glibc-functions/obstack_vprintf.texi: Update. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Fri, 27 Feb 2009 06:06:47 -0700
parents 5aa57cee93aa
children b7aa98412d0f
files ChangeLog doc/glibc-functions/obstack_printf.texi doc/glibc-functions/obstack_vprintf.texi doc/posix-functions/fprintf.texi doc/posix-functions/printf.texi doc/posix-functions/snprintf.texi doc/posix-functions/sprintf.texi doc/posix-functions/vfprintf.texi doc/posix-functions/vprintf.texi doc/posix-functions/vsnprintf.texi doc/posix-functions/vsprintf.texi m4/printf.m4
diffstat 12 files changed, 38 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-02-27  Eric Blake  <ebb9@byu.net>
+
+	Detect bug in cygwin 1.5.x *printf on 1-character %ls.
+	* m4/printf.m4 (gl_PRINTF_DIRECTIVE_LS): Enhance filter.
+	* doc/posix-functions/fprintf.texi: Update.
+	* doc/posix-functions/printf.texi: Update.
+	* doc/posix-functions/snprintf.texi: Update.
+	* doc/posix-functions/sprintf.texi: Update.
+	* doc/posix-functions/vfprintf.texi: Update.
+	* doc/posix-functions/vprintf.texi: Update.
+	* doc/posix-functions/vsnprintf.texi: Update.
+	* doc/posix-functions/vsprintf.texi: Update.
+	* doc/glibc-functions/obstack_printf.texi: Update.
+	* doc/glibc-functions/obstack_vprintf.texi: Update.
+
 2009-02-26  Eric Blake  <ebb9@byu.net>
 
 	avoid gcc 3.4.3 bug on long double NaN on Irix 6.5
--- a/doc/glibc-functions/obstack_printf.texi
+++ b/doc/glibc-functions/obstack_printf.texi
@@ -36,7 +36,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/glibc-functions/obstack_vprintf.texi
+++ b/doc/glibc-functions/obstack_vprintf.texi
@@ -36,7 +36,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/fprintf.texi
+++ b/doc/posix-functions/fprintf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/printf.texi
+++ b/doc/posix-functions/printf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/snprintf.texi
+++ b/doc/posix-functions/snprintf.texi
@@ -41,7 +41,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/sprintf.texi
+++ b/doc/posix-functions/sprintf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/vfprintf.texi
+++ b/doc/posix-functions/vfprintf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/vprintf.texi
+++ b/doc/posix-functions/vprintf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/vsnprintf.texi
+++ b/doc/posix-functions/vsnprintf.texi
@@ -41,7 +41,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/doc/posix-functions/vsprintf.texi
+++ b/doc/posix-functions/vsprintf.texi
@@ -30,7 +30,7 @@
 Cygwin 1.5.x, mingw, BeOS.
 @item
 This function does not support the @samp{ls} directive on some platforms:
-OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.
+OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, Cygwin 1.5.x.
 @item
 This function does not support precisions in the @samp{ls} directive correctly
 on some platforms:
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 31
+# printf.m4 serial 32
 dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -558,7 +558,7 @@
   if (sprintf (buf, "%F", 1.0 / 0.0) < 0
       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
     return 1;
-  /* This catches a Cygwin 2007 bug.  */
+  /* This catches a Cygwin 1.5.x bug.  */
   if (sprintf (buf, "%.F", 1234.0) < 0
       || strcmp (buf, "1234") != 0)
     return 1;
@@ -653,13 +653,19 @@
 {
   char buf[100];
   /* Test whether %ls works at all.
-     This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku.  */
+     This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku,
+     Cygwin 1.5.  */
   {
     static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "abc") != 0)
       return 1;
+    buf[0] = '\0';
+    wstring[1] = 0;
+    if (sprintf (buf, "%ls", wstring) < 0
+        || strcmp (buf, "a") != 0)
+      return 1;
   }
   /* Test whether precisions in %ls are supported as specified in ISO C 99
      section 7.19.6.1:
@@ -685,6 +691,7 @@
          solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
          irix*)           gl_cv_func_printf_directive_ls="guessing no";;
          beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+         cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
          *)               gl_cv_func_printf_directive_ls="guessing yes";;
        esac
 changequote([,])dnl
@@ -1384,8 +1391,9 @@
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  .  .  .  .  .  .
-dnl   Cygwin 2007 (= Cygwin 1.5.24)  .  .  .  .  #  #  .  .  .  .  ?  #  ?  ?  .  .  .  .  .  .
-dnl   Cygwin 2006 (= Cygwin 1.5.19)  #  .  .  .  #  #  .  ?  .  #  ?  #  ?  ?  .  .  .  .  .  .
+dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  .  .  .  .  .  .
+dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  .  .  .  .  .  .
+dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #