From: Paul Eggert <eggert@cs.ucla.edu>
To: 35548@debbugs.gnu.org
Subject: bug#35548: image.c uses deprecated rsvg_handle_write etc.
Date: Fri, 3 May 2019 12:23:32 -0700 [thread overview]
Message-ID: <ce4a8384-f6a8-ec4e-cb48-5a339fb861c7@cs.ucla.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
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.
[-- Attachment #2: 0001-Pacify-librsvg-2.45.1-and-later.patch --]
[-- Type: text/x-patch, Size: 2514 bytes --]
From da3897abf1e45741b122b52df37a5cbc68b2ad5d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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"
<https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
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
next reply other threads:[~2019-05-03 19:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 19:23 Paul Eggert [this message]
2019-07-04 3:14 ` bug#35548: image.c uses deprecated rsvg_handle_write etc YAMAMOTO Mitsuharu
2019-07-04 4:19 ` YAMAMOTO Mitsuharu
2019-07-10 19:44 ` Paul Eggert
2019-07-11 12:18 ` Andy Moreton
2019-07-11 12:52 ` Andy Moreton
2019-07-11 13:30 ` Eli Zaretskii
2019-07-11 14:28 ` Andy Moreton
2019-07-04 12:53 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ce4a8384-f6a8-ec4e-cb48-5a339fb861c7@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=35548@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).