From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#57219: 29.0.50; [PATCH] Fix gcc warning in coding.c Date: Sun, 14 Aug 2022 16:58:08 -0700 Message-ID: <87czd2cr8v.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6623"; mail-complaints-to="usenet@ciao.gmane.io" To: 57219@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 15 01:59:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNNVg-0001Y8-AI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 01:59:12 +0200 Original-Received: from localhost ([::1]:33688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNNVf-0006MZ-40 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 19:59:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNNVY-0006MK-Ba for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 19:59:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNNVW-0004pY-N0 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 19:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNNVW-00006C-FD for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 19:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2022 23:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57219 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1660521500304 (code B ref -1); Sun, 14 Aug 2022 23:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Aug 2022 23:58:20 +0000 Original-Received: from localhost ([127.0.0.1]:40063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNNUq-0008WU-HX for submit@debbugs.gnu.org; Sun, 14 Aug 2022 19:58:20 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNNUo-0008WL-0u for submit@debbugs.gnu.org; Sun, 14 Aug 2022 19:58:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNNUn-0006K0-Pi for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 19:58:17 -0400 Original-Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]:57907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNNUl-0004lT-AE for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 19:58:17 -0400 Original-Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 6759D200002 for ; Sun, 14 Aug 2022 23:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1660521491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=RvPeInDHAGEzVv0Vi0coG4wYrPMqglDyT+oAdUnGXUw=; b=ANWfdsuLF/6OXZ2GpGoEkEBbmt9JwJWuKMWwd+3uNcB1KZRMBSoFZ0kf6Rzb4bxKfltWxQ pcU38Uml4DYkOq8BoinT34mdfFhP97D/3lnPBJGsAFDyZRIpBXHR22DAlfgkz3cz347vfy 4OPTgKdxsC9soHq8Bl292lulxVNPydP3LVjGY9+mOCOFLZ7RjA58SdlzJxqYodghdGmSDt igomT8xyfEh0QJrqd/Yya78nL0W1785IHhWs58V/lg+/ziGjLpPiTBrv4JQmhbcF6o1B97 81ImFqyzxiR7zBmtHy025wpFr2A+iwRfILhaG2WuODzhhMBRKVHPNZ5XwoWUCg== Original-Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1oNNUe-001NuW-1T for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 16:58:08 -0700 Received-SPF: pass client-ip=2001:4b98:dc4:8::232; envelope-from=matt@rfc20.org; helo=relay12.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239710 Archived-At: --=-=-= Content-Type: text/plain gcc 12 is warning about a possible uninitialized variable in coding.c. Looks like Paul fixed the same warning in a nearby function years ago, so I used the same suppression technique here. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Pacify-warnings-from-gcc-12.patch >From ae25595681bdec33e271f3804d0ccfae132bb170 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Sun, 14 Aug 2022 16:41:56 -0700 Subject: [PATCH] Pacify warnings from gcc 12 * src/coding.c (encode_coding_object): Mark saved_pt_byte with UNINIT to silence a false alarm from -Wmaybe-uninitialized. This was already done in decode_coding_object. The fix is correct because saved_pt is used as a sentinel before saved_pt_byte is used. --- src/coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coding.c b/src/coding.c index 3fb4f148b1..0ae8eb3282 100644 --- a/src/coding.c +++ b/src/coding.c @@ -8283,7 +8283,7 @@ encode_coding_object (struct coding_system *coding, ptrdiff_t chars = to - from; ptrdiff_t bytes = to_byte - from_byte; Lisp_Object attrs; - ptrdiff_t saved_pt = -1, saved_pt_byte; + ptrdiff_t saved_pt = -1, saved_pt_byte UNINIT; bool need_marker_adjustment = 0; bool kill_src_buffer = 0; Lisp_Object old_deactivate_mark; -- 2.35.1 --=-=-=--