From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed 1/4] gdb/aix-thread: make state2str return const char *
Date: Tue, 24 Nov 2026 11:38:53 -0500 [thread overview]
Message-ID: <20261124163901.185016-1-simon.marchi@efficios.com> (raw)
Building aix-thread.c on AIX fails with:
../../../src/binutils-gdb/gdb/aix-thread.c:752:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
../../../src/binutils-gdb/gdb/aix-thread.c:755:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
../../../src/binutils-gdb/gdb/aix-thread.c:758:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
../../../src/binutils-gdb/gdb/aix-thread.c:761:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
../../../src/binutils-gdb/gdb/aix-thread.c:764:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
../../../src/binutils-gdb/gdb/aix-thread.c:767:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
Make state2str return `const char *`. Its only caller passes the result
to a printf-like function, so it doesn't need a non-const pointer.
Change-Id: I686245abdfe6a4e3b40a8c467ea736a6bf18dd4b
---
gdb/aix-thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index ff41791acd28..96fd09a1b626 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -742,7 +742,7 @@ pdc_dealloc (pthdb_user_t user_current_pid, void *buf)
/* Return a printable representation of pthread STATE. */
-static char *
+static const char *
state2str (pthdb_state_t state)
{
switch (state)
base-commit: 00c604b72792b914b93de07468f2a470b3d2cf4f
--
2.56.1
next reply other threads:[~2026-11-24 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 16:38 Simon Marchi [this message]
2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
2026-11-24 16:38 ` [pushed 3/4] gdb/aix-thread: remove unused priv variables Simon Marchi
2026-11-24 16:38 ` [pushed 4/4] gdb/aix-thread: fix misleading indentation in store_regs_user_thread 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=20261124163901.185016-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.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