From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#35548: image.c uses deprecated rsvg_handle_write etc. Date: Fri, 3 May 2019 12:23:32 -0700 Organization: UCLA Computer Science Department Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------683BF9C6344994A21CDD0323" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257346"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: 35548@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 03 23:14:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMfVe-0012u5-N0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 May 2019 23:14:22 +0200 Original-Received: from localhost ([127.0.0.1]:46329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMdn1-0004AV-3M for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 May 2019 15:24:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMdmt-0004AE-Hg for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:24:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMdms-0004je-Ax for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMdms-0004jS-75 for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMdmr-0002iR-V2 for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 May 2019 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35548 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs bugs Original-Received: via spool by submit@debbugs.gnu.org id=B.155691142810416 (code B ref -1); Fri, 03 May 2019 19:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2019 19:23:48 +0000 Original-Received: from localhost ([127.0.0.1]:49690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMdme-0002hw-4Q for submit@debbugs.gnu.org; Fri, 03 May 2019 15:23:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMdmc-0002hk-BQ for submit@debbugs.gnu.org; Fri, 03 May 2019 15:23:47 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMdmX-0004cK-7g for submit@debbugs.gnu.org; Fri, 03 May 2019 15:23:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMdmV-0004A1-OU for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:23:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMdmT-0004am-Hb for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:23:39 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46720) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMdmR-0004a6-Ug for bug-gnu-emacs@gnu.org; Fri, 03 May 2019 15:23:36 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 397051618F7 for ; Fri, 3 May 2019 12:23:34 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zS-66dCYgoEd for ; Fri, 3 May 2019 12:23:33 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 17744161911 for ; Fri, 3 May 2019 12:23:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xUsvW1v2swlk for ; Fri, 3 May 2019 12:23:32 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F17DC161910 for ; Fri, 3 May 2019 12:23:32 -0700 (PDT) Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECH Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158688 Archived-At: This is a multi-part message in MIME format. --------------683BF9C6344994A21CDD0323 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I just upgraded my Emacs build platform to Fedora 30 and found that Emacs wouldn't build when configured with --enable-gcc-warnings. The problem is that starting in librsvg 2.45.1, the librsvg functions rsvg_handle_write and rsvg_handle_close are deprecated, and Emacs calls those functions. Although I pacified GCC by installing the attached patch into Emacs master, the underlying problem is still there and an rsvg expert should take a look at this at some point. --------------683BF9C6344994A21CDD0323 Content-Type: text/x-patch; name="0001-Pacify-librsvg-2.45.1-and-later.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Pacify-librsvg-2.45.1-and-later.patch" >From da3897abf1e45741b122b52df37a5cbc68b2ad5d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 3 May 2019 12:16:33 -0700 Subject: [PATCH] Pacify librsvg 2.45.1 and later * src/image.c (svg_load_image): Pacify librsvg 2.45.1 and later, and add a FIXME comment about the deprecated librsvg functions. --- src/image.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/image.c b/src/image.c index bf594987eb..3d724a773b 100644 --- a/src/image.c +++ b/src/image.c @@ -6735,7 +6735,7 @@ my_error_exit (j_common_ptr cinfo) /* Init source method for JPEG data source manager. Called by - jpeg_read_header() before any data is actually read. See + jpeg_read_header before any data is actually read. See libjpeg.doc from the JPEG lib distribution. */ static void @@ -6745,7 +6745,7 @@ our_common_init_source (j_decompress_ptr cinfo) /* Method to terminate data source. Called by - jpeg_finish_decompress() after all data has been processed. */ + jpeg_finish_decompress after all data has been processed. */ static void our_common_term_source (j_decompress_ptr cinfo) @@ -9456,7 +9456,18 @@ svg_load_image (struct frame *f, struct image *img, char *contents, See rsvg bug 596114 - "image refs are relative to curdir, not .svg file" . */ if (filename) - rsvg_handle_set_base_uri(rsvg_handle, filename); + rsvg_handle_set_base_uri (rsvg_handle, filename); + + /* Suppress GCC deprecation warnings starting in librsvg 2.45.1 for + rsvg_handle_write and rsvg_handle_close. FIXME: Use functions + like rsvg_handle_new_from_gfile_sync on newer librsvg versions, + and remove this hack. */ + #if GNUC_PREREQ (4, 6, 0) + #pragma GCC diagnostic push + #endif + #if LIBRSVG_CHECK_VERSION (2, 45, 1) && GNUC_PREREQ (4, 2, 0) + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif /* Parse the contents argument and fill in the rsvg_handle. */ rsvg_handle_write (rsvg_handle, (unsigned char *) contents, size, &err); @@ -9467,6 +9478,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents, rsvg_handle_close (rsvg_handle, &err); if (err) goto rsvg_error; + #if GNUC_PREREQ (4, 6, 0) + #pragma GCC diagnostic pop + #endif + rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); if (! check_image_size (f, dimension_data.width, dimension_data.height)) { -- 2.21.0 --------------683BF9C6344994A21CDD0323--