From 79dd80fb31df6dc6a3f68db1f8fa393a808a154b Mon Sep 17 00:00:00 2001
From: Eric Blake <ebb9@byu.net>
Date: Wed, 18 Jun 2008 10:50:06 -0600
Subject: [PATCH] Work around cygwin 1.5.25 strsignal bug.

* tests/test-strsignal.c: Allow for const char *.
* doc/glibc-functions/strsignal.texi (strsignal): Document the bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
---
 ChangeLog                          |  6 ++++++
 doc/glibc-functions/strsignal.texi | 16 ++++++++++++----
 tests/test-strsignal.c             |  6 +++++-
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95f13fe605..30d8235843 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-18  Eric Blake  <ebb9@byu.net>
+
+	Work around cygwin 1.5.25 strsignal bug.
+	* tests/test-strsignal.c: Allow for const char *.
+	* doc/glibc-functions/strsignal.texi (strsignal): Document the bug.
+
 2008-06-18  Simon Josefsson  <simon@josefsson.org>
 
 	* users.txt: Update URL to article and add author/date
diff --git a/doc/glibc-functions/strsignal.texi b/doc/glibc-functions/strsignal.texi
index 80ad6dadb6..65c0b1b96b 100644
--- a/doc/glibc-functions/strsignal.texi
+++ b/doc/glibc-functions/strsignal.texi
@@ -2,15 +2,23 @@
 @subsection @code{strsignal}
 @findex strsignal
 
-Gnulib module: ---
+Gnulib module: strsignal
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function is missing on some platforms:
+AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw.
+
+@item
+This function does not return a string for out-of-range numbers on
+some platforms:
+Solaris, AIX 5.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
-@item
-This function is missing on some platforms:
-AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw.
+This function returns @code{const char *} instead of @code{char *} on
+some platforms:
+cygwin 1.5.25.
 @end itemize
diff --git a/tests/test-strsignal.c b/tests/test-strsignal.c
index 8cc955bdc3..8868346e6f 100644
--- a/tests/test-strsignal.c
+++ b/tests/test-strsignal.c
@@ -46,7 +46,11 @@
 int
 main (int argc, char **argv)
 {
-  char *str;
+  /* Work around bug in cygwin 1.5.25 <string.h> by declaring str as
+     const char *, even though strsignal is supposed to return char *.
+     At any rate, this doesn't hurt, since POSIX 200x states that "The
+     string pointed to shall not be modified by the application."  */
+  const char *str;
 
   /* We try a couple of signals, since not all signals are supported
      everywhere.  Notwithstanding the #ifdef for neatness, SIGINT should in
-- 
2.30.2