From patchwork Sat Mar 11 11:46:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 1755724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=CADBhxOw; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=gmx.net header.i=ps.report@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=GJ8ijoxR; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PYh6f5pwJz1yWv for ; Sat, 11 Mar 2023 22:49:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mco6dR8I+Njsunn7ptMof5XyVVtC/6QE5Yn9FTr/0P0=; b=CADBhxOwhxwmdJ UU4pMtPlv5HWxXMWDayFtZnSTSuudlwe2U7XUL4M1YOlm6GhU5aH/tppU57tQYBasFX8bPFpqUE5n 9U35sQ5++s/QkAJl+PhDxjWq8hpqpBBcqbMPbeFKPl+ec4DvlSJ2klajeNiww2ZEtZEOEoqQrK1Oz f0zhuUNsNhq0foecZWYy45QXIBDTn3Mx41cUBE1qi9XjRa9Zu8F/V2+OffHEY8FwyoiNu+IhGdldU KZLbdTeAEcU1+rFBTzd79pVjgnC4xz/PkU0RcqAAdadiKts/o9kgj8mb2UrhTLHzX2IH1jU6NUDHE xKqcHg2AmVuXAuHwausw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paxgk-000P52-QU; Sat, 11 Mar 2023 11:47:02 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paxgh-000P3E-AN for openwrt-devel@lists.openwrt.org; Sat, 11 Mar 2023 11:47:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1678535213; i=ps.report@gmx.net; bh=bTBi5nH1OhcX7k84o1bPtN/Fd8OyIiebETad0v0R9BM=; h=X-UI-Sender-Class:From:To:Subject:Date; b=GJ8ijoxRjYbwf6cDH3LieJ0kmAc7KwpYiCFD52HGEQzXJQ/A+iFSFtEQrjIvwssdH 0RIsV5XJPkp8vwXWbEAEpXbyNGtHAX5mbXktMu2et/AkGQ8c66PBITHdhwYs51oSaB N8FeLUfDPyUXPh2CfskfJBhq6Xjw4WD6fsYA0v6pX5rV6ZRASb5dJoMKZPkCJJvv7F EQuJ+FjTPok7CnxAtN3+RZkhkwYaELRrjXcylSMNBuBu4zCd+K6M+i7N9LKrYek4qM 7Lg3i7p+6QNChXe8Ig4MvZk4BmDYI1q3U5YW2QkFHRU1R26KHWn+NPk/8tX0X6y7/8 EHbJFehB1JFmw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost.fritz.box ([62.216.208.12]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mj8qd-1qDtXc0J5J-00f8uK for ; Sat, 11 Mar 2023 12:46:53 +0100 From: Peter Seiderer To: openwrt-devel@lists.openwrt.org Subject: [PATCH uqmi v2] uqmi: avoid gcc-12.x false error reporting (storing the address of local variable 'complete' in '*req.complete') Date: Sat, 11 Mar 2023 12:46:52 +0100 Message-Id: <20230311114652.23804-1-ps.report@gmx.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:8GYRooUipQVNxU3pVX6U2CE6H/SzaPrNf2mU2r4iKcNIHWwkvQw EoCaeXM+dSrAr3Vli29MHZqApSVWYyhP7uAdfmn34JTbgOpSoavUCxQX/fABnZYi0y9zIQs X4mq+6C2g3wGYvhoHQJfWjcBL4Uwtaep+h6VJ7xVwWK/u8JJv/tyRNEARjuTU9t1SbHme4M fGU7iJXbwNKBKIRrugIAg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:3ao/clCwRjc=;NpmUwTVBDvlv2S5CzhZh3Ys4QeP PgfJWrQ3yx/G7q4PBToqJeTXR3QAO7avMqs/a6MndIrz1CV88vOrgqICsAiY82fJ/xSUNfiNC X5RiYZZQZ3rnEIseKeLCL0BJVp5bmwEskJnBySTNqVt6x+/CrI6iTIUWzOJiToTvddiuFyMZA 1Kbdvm47kALTiFW2zo4zeF5yRD/ku8Gyypm7oPtnv38lrSSOApvDlCoAW8uzPb6ZV0XjNhgqd /oGxQ9wCch3/2NPgn3gKUPqi0chSAonOmjVCkUUUNy7ew6NJJEYOPaTVM5GK4mgq58Zx+wOKj gV3Prdnqr99AMec3qDVeZMMSM2rYYOehdAj+oMytAtfk///fM0Ayo//aHdwT/BpSyRF+k7Ne6 Oq3a8twzK6FmqnUWjzmOFCWKcXUP80dpXz432Gntywb4GuK5mLNcQ/W/D7OZlRC4snex4aq8e Z8TVbqdd3lx2094rohCsQAAPOuFgjFN86MJKX0WsAZQotj2NHJgpLRSYGEpdM58j5PVVOsr5W Fokjm94WjxgIV/MeulkveRvUPisBLDYHPTgWsRQYuZHZuNt3WBdGQXugUmFrUBp0MxlxW4S7u F1o/O8CN9GqR63e9jyACrX5ikf+Atu9BFnw5+vkMWyOdgJZZ+RO6vQ4lbhIno/QWRtcbDIy6O JIma4vJUmK1OHxdPhZuMCVDft8vZV5f424BAbI/ZqCCx74AsO4iFqle60ME1HQGexj4OLsbU8 EOgK6dzBAQQfFpLnMZP2a4yvVrTzv57nzgxsGz3l19KFdtk0aTanafcLqKWvKf6cVSA/J91oy lITBsvDZocRTYNmq7vp410kykRS//s7v5gRls+KMgt79ZJlNjLXzDxYC+TfycWs8tOAahK47x v52WKjgYETrKSur4r8+yyPqImlzIQsd418nwGIW+OXJTvwXAEoNj2u9P1ELNiv3EkriH3VQxA UNaBZPk0Ll094hkrU2KiWzzPZOU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230311_034659_672093_0F62695C X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Avoid gcc-12.x false error reporting (req->complete is later reset to NULL in case of use of local complete): dev.c:217:23: error: storing the address of local variable 'complete' in '*req.complete' [-Werror=dangling-pointer=] 217 | req->complete = &complete; | ~~~~~~~~~~~~~~^~~~~~~~~~~ Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.18 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ps.report[at]gmx.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.18 listed in wl.mailspike.net] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Avoid gcc-12.x false error reporting (req->complete is later reset to NULL in case of use of local complete): dev.c:217:23: error: storing the address of local variable 'complete' in '*req.complete' [-Werror=dangling-pointer=] 217 | req->complete = &complete; | ~~~~~~~~~~~~~~^~~~~~~~~~~ Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - apply pragma ignored only for gcc >= 12.x (as the warning '-Wdangling-pointer' was introduced with gcc-12.x) --- dev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dev.c b/dev.c index bd10207..dbd42d4 100644 --- a/dev.c +++ b/dev.c @@ -203,6 +203,15 @@ void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req) __qmi_request_complete(qmi, req, NULL); } +/* avoid gcc-12.x false error reporting: + * dev.c:217:23: error: storing the address of local variable ‘complete’ in ‘*req.complete’ [-Werror=dangling-pointer=] + * 217 | req->complete = &complete; + * | ~~~~~~~~~~~~~~^~~~~~~~~~~ + */ +#if __GNUC__ >= 12 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req) { bool complete = false; @@ -231,6 +240,9 @@ int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req) return req->ret; } +#if __GNUC__ >= 12 +#pragma GCC diagnostic pop +#endif struct qmi_connect_request { struct qmi_request req;