From 2c19758174425c00c37d5435d88ad61f3a1f42a9 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 19 Jun 2008 15:17:56 +0000 Subject: [PATCH] 2008-06-19 Eric Blake Adjust strsignal to POSIX 200x prototype. * strsignal.c (strsignal): Remove const. --- libiberty/ChangeLog | 31 ++++++++++++++++++------------- libiberty/strsignal.c | 14 ++++++++------ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index c9380bbd93..b77e66df94 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2008-06-19 Eric Blake + + Adjust strsignal to POSIX 200x prototype. + * strsignal.c (strsignal): Remove const. + 2008-06-17 Ralf Wildenhues * configure: Regenerate. @@ -123,9 +128,9 @@ * pexecute.txh (pex_free): Document process killing. 2007-08-31 Douglas Gregor - + * cp-demangle.c (d_dump): Handle - DEMANGLE_COMPONENT_RVALUE_REFERENCE. + DEMANGLE_COMPONENT_RVALUE_REFERENCE. (d_make_comp): Ditto. (cplus_demangle_type): Ditto. (d_print_comp): Ditto. @@ -252,7 +257,7 @@ * testsuite/Makefile.in: Add dummy install-pdf target. 2007-03-01 Peter Breitenlohner - Eric Botcazou + Eric Botcazou PR other/16513 * Makefile.in: Install library under $(MULTIOSDIR), not $(MULTISUBDIR). @@ -263,7 +268,7 @@ * configure.ac: add djgpp-specific results, so we don't have to link during a cross compilation. * configure: Regenerated. - + 2007-01-31 Ralf Wildenhues * hex.c: Fix typo. @@ -273,7 +278,7 @@ 2007-01-31 Vladimir Prus * pex-common.h (struct pex_obj): New fields - stderr_pipe and read_err. + stderr_pipe and read_err. * pex-common.c (pex_init_common): Initialize stderr_pipe. (pex_run_in_environment): Add error checking @@ -362,7 +367,7 @@ the end of the string. 2006-11-30 Andrew Stubbs - J"orn Rennecke + J"orn Rennecke PR driver/29931 * make-relative-prefix.c (make_relative_prefix_1): New function, @@ -377,7 +382,7 @@ (std_suffixes): Add "" as first element. (find_executable): Remove detection of already-present extension. Try all suffixes in std_suffixes. - + 2006-11-07 Julian Brown * floatformat.c (get_field): Fix segfault with little-endian word @@ -396,7 +401,7 @@ 2006-10-25 Ben Elliston * pexecute.txh: Wrap pexecute's "flag" argument with @var {..}. - + 2006-10-10 Brooks Moses * Makefile.in: Added "pdf", "libiberty.pdf" target support. @@ -501,8 +506,8 @@ 2006-04-06 Carlos O'Donell * Makefile.in: Add install-html, install-html-am, and - install-html-recursive targets. Define mkdir_p and - NORMAL_INSTALL. + install-html-recursive targets. Define mkdir_p and + NORMAL_INSTALL. * configure.ac: AC_SUBST datarootdir, docdir, htmldir. * configure: Regenerate. * testsuite/Makefile.in: Add install-html and html targets. @@ -552,7 +557,7 @@ 2006-01-29 Gabriel Dos Reis * configure.ac: Add -Wc++-compat to ac_libibety_warn_cflags where - supported. + supported. * configure: Regenerated. 2006-01-20 Carlos O'Donell @@ -582,7 +587,7 @@ * testsuite/test-demangle.c (main): Recognize option --ret-postfix * testsuite/demangle-expected: Test cases to verify extended encoding. Updated comment to document --ret-postfix option. - + 2005-11-06 Richard Guenther * splay-tree.c (rotate_left): New function. @@ -718,7 +723,7 @@ 2005-06-30 Daniel Berlin * hashtab.c (EMPTY_ENTRY): Moved and renamed. - (DELETED_ENTRY): Ditto. + (DELETED_ENTRY): Ditto. 2005-06-20 Geoffrey Keating diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c index 4ca9e21d11..666b1b4f15 100644 --- a/libiberty/strsignal.c +++ b/libiberty/strsignal.c @@ -404,10 +404,10 @@ call to @code{strsignal}. #ifndef HAVE_STRSIGNAL -const char * +char * strsignal (int signo) { - const char *msg; + char *msg; static char buf[32]; #ifndef HAVE_SYS_SIGLIST @@ -428,14 +428,16 @@ strsignal (int signo) { /* In range, but no sys_siglist or no entry at this index. */ sprintf (buf, "Signal %d", signo); - msg = (const char *) buf; + msg = buf; } else { - /* In range, and a valid message. Just return the message. */ - msg = (const char *) sys_siglist[signo]; + /* In range, and a valid message. Just return the message. We + can safely cast away const, since POSIX says the user must + not modify the result. */ + msg = (char *) sys_siglist[signo]; } - + return (msg); } -- 2.34.1