Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed 1/4] gdb/aix-thread: make state2str return const char *
@ 2026-11-24 16:38 Simon Marchi
  2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Marchi @ 2026-11-24 16:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-24 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 16:38 [pushed 1/4] gdb/aix-thread: make state2str return const char * Simon Marchi
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox