From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CTH8C2UbmWlfhAMAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 21:41:41 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=sHj4pzOb; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2A2341E08D; Fri, 20 Feb 2026 21:41:41 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8B28C1E08D for ; Fri, 20 Feb 2026 21:41:40 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 313524BAD152 for ; Sat, 21 Feb 2026 02:41:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 313524BAD152 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=sHj4pzOb Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 9FA044BA23EE for ; Sat, 21 Feb 2026 02:41:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9FA044BA23EE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9FA044BA23EE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771641665; cv=none; b=JsMzcDHj/4IYwdS0HClm0YQBmWjx179eLp3qLl0QEpwkfNEz8VAGh627ohPCkGh6w6Jo9wC0fXOw3qocMocuah2CSB0fZjfP++iPHpuInsiMqdWRWGCb4O7e406VNwjXc2fquIyFluZ8jc8cIC/ejKe7xFRQsD4bne+dp6X+zkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771641665; c=relaxed/simple; bh=PHUUtQPl9qigxwKMiTOMUaezZva7TymgL+G5mt2vQxY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cppDDVqHIOi6EJ0XH4bUKImQZEZtIA3+qsQBJCCd9XssRXlMt3vXprCVqtnbWzitgsc6ySM3A8mFzOEnvwGzpLf7g3KIoHRjZtRBf9hmyfpF9nZFCQDS3DAKMbHkJTB3ZLcDFbMw4HTV06AdQkRMaanhXuPfefLYAOSLbtZ2Me0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FA044BA23EE Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 61L2exv3238607 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Feb 2026 21:41:03 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 61L2exv3238607 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1771641664; bh=uoTNm2GHBFQteUhYwFRi3WjMBR7agFmNFBtDBJBqfGA=; h=From:To:Cc:Subject:Date:From; b=sHj4pzObXbZLlw8k4wuJW3z8sJzhhD61q4zj5zyNpiaURWmhZwUmWSRrIP9tvRcVs dpdAzMeCb/qeAlMz5Ky8p4REwZkbhVmcEw/luvblxwCgNmIGfaZa7D+Cz88JBpHPnq H0j9s60Rn5TAbr8WLkXe+/rBt+OYI+U5dCS3uOrhHLKd3EsLBnfzzaBVxNQS+1bUC7 e+ubOzoW+JlT/EGmgAl5NWu8EbTULnCrXJ1SDD7jBI9L49ghrwv3JeLpIRJpw+dTXn Oleppm1JGeoBID7eabvqZwMcwZyL9Rx2I4SSQBUQlsBmmcRh5PnewzCwRnZNLWN5FN R7/wi0qlAlVZA== Received: by simark.ca (Postfix) id 365B41E08D; Fri, 20 Feb 2026 21:40:59 -0500 (EST) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/python: remove some unreachable Py_RETURN_NONE Date: Fri, 20 Feb 2026 21:40:54 -0500 Message-ID: <20260221024058.2573546-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 21 Feb 2026 02:40:59 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Simon Marchi 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