diff options
author | Eric Blake <ebb9@byu.net> | 2008-06-19 15:17:56 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2008-06-19 15:17:56 +0000 |
commit | 2c19758174425c00c37d5435d88ad61f3a1f42a9 (patch) | |
tree | 895c2dadbc8d3de890cd28875a5a783a7c91015b /libiberty/strsignal.c | |
parent | 17526a8c50f35e9a89f2d573f0dd529926118f4f (diff) | |
download | gdb-2c19758174425c00c37d5435d88ad61f3a1f42a9.zip gdb-2c19758174425c00c37d5435d88ad61f3a1f42a9.tar.gz gdb-2c19758174425c00c37d5435d88ad61f3a1f42a9.tar.bz2 |
2008-06-19 Eric Blake <ebb9@byu.net>
Adjust strsignal to POSIX 200x prototype.
* strsignal.c (strsignal): Remove const.
Diffstat (limited to 'libiberty/strsignal.c')
-rw-r--r-- | libiberty/strsignal.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c index 4ca9e21..666b1b4 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); } |