public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [FYI] Make "msg" const in internal_vproblem
@ 2019-04-11 19:01 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-04-11 19:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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(-)

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)
       {
-- 
2.20.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-11 19:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11 19:01 [FYI] Make "msg" const in internal_vproblem Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).