Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 01/10] Constify coffread.c:getsymname
Date: Fri, 16 Jan 2026 12:11:29 -0700	[thread overview]
Message-ID: <20260116-coffread-cleanups-v1-1-4d46090fad69@adacore.com> (raw)
In-Reply-To: <20260116-coffread-cleanups-v1-0-4d46090fad69@adacore.com>

I noticed that the symbol name in coffread.c can be const.
---
 gdb/coffread.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/coffread.c b/gdb/coffread.c
index 18641aafd18..dc5550af4a2 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -71,7 +71,7 @@ static int pe_file;
 
 struct coff_symbol
   {
-    char *c_name;
+    const char *c_name;
     int c_naux;			/* 0 if syment only, 1 if syment +
 				   auxent, etc.  */
     CORE_ADDR c_value;
@@ -86,7 +86,7 @@ static long stringtab_length = 0;
 /* Used when reading coff symbols.  */
 static int symnum;
 
-static char *getsymname (struct internal_syment *);
+static const char *getsymname (struct internal_syment *);
 
 static int init_stringtab (bfd *, file_ptr, gdb::unique_xmalloc_ptr<char> *);
 
@@ -636,11 +636,11 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr<char> *stora
   return 0;
 }
 
-static char *
+static const char *
 getsymname (struct internal_syment *symbol_entry)
 {
   static char buffer[SYMNMLEN + 1];
-  char *result;
+  const char *result;
 
   if (symbol_entry->_n._n_n._n_zeroes == 0)
     {

-- 
2.52.0


  reply	other threads:[~2026-01-16 19:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 19:11 [PATCH 00/10] More coffread cleanups Tom Tromey
2026-01-16 19:11 ` Tom Tromey [this message]
2026-01-16 19:11 ` [PATCH 02/10] Clean up a comment in coffread.c Tom Tromey
2026-01-16 19:11 ` [PATCH 03/10] Fix indentation " Tom Tromey
2026-01-17  3:54   ` Simon Marchi
2026-01-20 15:47     ` Tom Tromey
2026-01-16 19:11 ` [PATCH 04/10] Change coffread.c:pe_file to bool Tom Tromey
2026-01-16 19:11 ` [PATCH 05/10] Remove redundant nlist_bfd_global Tom Tromey
2026-01-16 19:11 ` [PATCH 06/10] Use symfile_bfd in more places Tom Tromey
2026-01-17  4:09   ` Simon Marchi
2026-01-17  4:19     ` Simon Marchi
2026-01-17  4:10   ` Simon Marchi
2026-01-16 19:11 ` [PATCH 07/10] Use coffread_objfile throughout coffread.c Tom Tromey
2026-01-16 19:11 ` [PATCH 08/10] Remove coff_symfile_init Tom Tromey
2026-01-17  4:13   ` Simon Marchi
2026-01-20 15:54     ` Tom Tromey
2026-01-16 19:11 ` [PATCH 09/10] Remove all globals from coffread.c Tom Tromey
2026-01-16 19:11 ` [PATCH 10/10] Change is_import_fixup_symbol to return bool Tom Tromey
2026-01-17  4:20 ` [PATCH 00/10] More coffread cleanups Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260116-coffread-cleanups-v1-1-4d46090fad69@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox