Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb/python: remove some unreachable Py_RETURN_NONE
@ 2026-02-21  2:40 simon.marchi
  2026-02-23 12:50 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: simon.marchi @ 2026-02-21  2:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

They are unreachable because there is a return statement in all possible code
paths before.

Change-Id: I9db2f41f8017380c0c79f97af9bbf8734038ba9a
---
 gdb/python/py-frame.c   | 4 ----
 gdb/python/py-objfile.c | 4 ----
 gdb/python/py-unwind.c  | 2 --
 3 files changed, 10 deletions(-)

diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index ab7883b4e73b..99a902f76684 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -611,8 +611,6 @@ frapy_level (PyObject *self, PyObject *args)
     {
       return gdbpy_handle_gdb_exception (nullptr, except);
     }
-
-  Py_RETURN_NONE;
 }
 
 /* The language for this frame.  */
@@ -634,8 +632,6 @@ frapy_language (PyObject *self, PyObject *args)
     {
       return gdbpy_handle_gdb_exception (nullptr, except);
     }
-
-  Py_RETURN_NONE;
 }
 
 /* The static link for this frame.  */
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 36acdb06a25c..ed9f4d6bd968 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -483,8 +483,6 @@ objfpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
     {
       return gdbpy_handle_gdb_exception (nullptr, except);
     }
-
-  Py_RETURN_NONE;
 }
 
 /* Implementation of
@@ -518,8 +516,6 @@ objfpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
     {
       return gdbpy_handle_gdb_exception (nullptr, except);
     }
-
-  Py_RETURN_NONE;
 }
 
 /* Implement repr() for gdb.Objfile.  */
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index d4c35e17f145..36ebf97be06b 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -599,8 +599,6 @@ pending_framepy_language (PyObject *self, PyObject *args)
     {
       return gdbpy_handle_gdb_exception (nullptr, except);
     }
-
-  Py_RETURN_NONE;
 }
 
 /* Implement PendingFrame.find_sal().  Return the PendingFrame's symtab and

base-commit: 646982f4295bf0a1e64867606d496c34c9a15a0c
-- 
2.53.0


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

end of thread, other threads:[~2026-02-23 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-21  2:40 [PATCH] gdb/python: remove some unreachable Py_RETURN_NONE simon.marchi
2026-02-23 12:50 ` Tom Tromey
2026-02-23 13:22   ` Simon Marchi

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