This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Make "msg" const in internal_vproblem
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 11 Apr 2019 19:03:32 -0000
- Subject: [binutils-gdb] Make "msg" const in internal_vproblem
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=02cf60c7a42710ee0364698c436b6ca5e771374b
commit 02cf60c7a42710ee0364698c436b6ca5e771374b
Author: Tom Tromey <tromey@adacore.com>
Date: Thu Apr 11 13:00:48 2019 -0600
Make "msg" const in internal_vproblem
I noticed that the "msg" variable in internal_vproblem could be
"const". This seems like an improvement because it can wind up in
rodata.
Tested by rebuilding.
gdb/ChangeLog
2019-04-11 Tom Tromey <tromey@adacore.com>
* utils.c (internal_vproblem): Make "msg" const.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/utils.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a5cbc89..7428ed9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-11 Tom Tromey <tromey@adacore.com>
+
+ * utils.c (internal_vproblem): Make "msg" const.
+
2019-04-11 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_analyze_prologue_test): Reset saved regs.
diff --git a/gdb/utils.c b/gdb/utils.c
index 840779a..700f54f 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -300,7 +300,7 @@ internal_vproblem (struct internal_problem *problem,
/* Don't allow infinite error/warning recursion. */
{
- static char msg[] = "Recursive internal problem.\n";
+ static const char msg[] = "Recursive internal problem.\n";
switch (dejavu)
{