Can you show that part from a preprocessed image.c?
What's the "preprocessed" image.c? In any case, here's that part of image.c after reverted all local changes to it so that it's the exact same as on master:
/* 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
#if LIBRSVG_CHECK_VERSION (2, 45, 1) && GNUC_PREREQ (4, 2, 0)
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
PS: I was able to build emacs locally after commenting out the "
#if LIBRSVG_CHECK_VERSION .. #endif" portion.