Detect bug in cygwin 1.5.x *printf on 1-character %ls.
authorEric Blake <ebb9@byu.net>
Fri, 27 Feb 2009 13:06:47 +0000 (06:06 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 27 Feb 2009 13:06:47 +0000 (06:06 -0700)
* 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>
12 files changed:
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

index 90f91f6cc82c98e0bfa75d5a2a881ec12b4ae4ea..c0428c0c822f7eefa554b5125605fd144218c0b5 100644 (file)
--- 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
index 7a5726486f4430d651a4242c2d1d8d063930cf98..3f0948773f3cc2765d09cb952f17e3cb24b0a6ed 100644 (file)
@@ -36,7 +36,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 8556f74b7b6bd30cc8cd3dadee6c9f274dd7a8d5..477b40ad995211fbe68c0e5d30f5a292d4c2559e 100644 (file)
@@ -36,7 +36,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 0434e4422e4b79c73e0030fe18698de53af56974..70230b94f29d20832c3e7ab1e48cc104448e7205 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 1783ad22626e7be55a38ca2fe9d5da7a171e5041..4475e90fe3b110517d19e3aac8fd8ef21383628d 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index d8ecbcccd651ac542de8e6463e867894e96eb5cd..e4cfee1b040ff4c88861a9056ff156882b69eaab 100644 (file)
@@ -41,7 +41,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 003fb44b853fd2b5836eed8eabf895220c14cf80..0ef53b8bc1e8e7a3870549cd71c2917371078034 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 37c2d11b1f38b6faf1010db0b5d066ad18f082e4..9e54bf96801466a3737a1d39d9a2587b1e434ce8 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 453117245f86af7c4bd06aeedbde8441ccf8a1b3..d69bd735c0dee069c0cc8ea03321c6350a522126 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index f09e0543ac6e9cc65c5f220317cfb3a2b41d3c12..0b41da599a3393f371e159256954bfaf80f62d2b 100644 (file)
@@ -41,7 +41,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index d477b4b3f48390d0118f13bddb837a637524a247..6d7b111dd754c55e095101d1d496b023c71f0c86 100644 (file)
@@ -30,7 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
 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:
index 4207ace49f3972687b86130c00f0cda9d427c527..6da62dfffa8f899129df158617d2fc02b837e0cc 100644 (file)
@@ -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 @@ int main ()
   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 @@ int main ()
 {
   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 @@ changequote(,)dnl
          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   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  .
 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                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #