[FYI] Make "msg" const in internal_vproblem

Message ID 20190411190138.5335-1-tromey@adacore.com
State New, archived
Headers

Commit Message

Tom Tromey April 11, 2019, 7:01 p.m. UTC
  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.
---
 gdb/ChangeLog | 4 ++++
 gdb/utils.c   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/utils.c b/gdb/utils.c
index 840779a6307..700f54f9ad3 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)
       {