[review] Fix up safe_strerror constification
Commit Message
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/478
......................................................................
Fix up safe_strerror constification
The earlier patch to constify safe_strerror missed a couple of spots,
corrected here.
gdb/ChangeLog
2019-10-31 Tom Tromey <tromey@adacore.com>
* gdbsupport/mingw-strerror.c (safe_strerror): Constify result.
* gdbsupport/gdb-dlfcn.c (gdb_dlopen): Update.
Change-Id: I2b8be88444ad8b5e92e9d57d28e66874142b72f7
---
M gdb/ChangeLog
M gdb/gdbsupport/gdb-dlfcn.c
M gdb/gdbsupport/mingw-strerror.c
3 files changed, 7 insertions(+), 2 deletions(-)
Comments
Christian Biesinger has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/478
......................................................................
Patch Set 1: Code-Review+1
Thanks, I should've grepped instead of relying on the compiler.
Sergio Durigan Junior has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/478
......................................................................
Patch Set 1: Code-Review+1
LGTM, thanks for fixing the breakage.
Tom Tromey has abandoned this change. ( https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/478 )
Change subject: Fix up safe_strerror constification
......................................................................
Abandoned
I pushed this but somehow the change-id changed so gerrit did not notice.
@@ -1,5 +1,10 @@
2019-10-31 Tom Tromey <tromey@adacore.com>
+ * gdbsupport/mingw-strerror.c (safe_strerror): Constify result.
+ * gdbsupport/gdb-dlfcn.c (gdb_dlopen): Update.
+
+2019-10-31 Tom Tromey <tromey@adacore.com>
+
* gdbsupport/gdb-dlfcn.c (gdb_dlopen): Use safe_strerror.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
@@ -73,7 +73,7 @@
error (_("Could not load %s: %s"), filename, dlerror());
#else
{
- char *msg = safe_strerror (GetLastError ());
+ const char *msg = safe_strerror (GetLastError ());
error (_("Could not load %s: %s"), filename, msg);
}
#endif
@@ -28,7 +28,7 @@
unfortunately this includes all socket-related error codes.
This replacement tries to find a system-provided error message. */
-char *
+const char *
safe_strerror (int errnum)
{
static char *buffer;