From dd2a8468904c2da57b4f1efe812c31742b4ff6aa Mon Sep 17 00:00:00 2001 From: dickmao Date: Sun, 5 Dec 2021 23:29:51 +0100 Subject: [PATCH] Add workaround to compilation warning in gcc 10.x in image.c * src/image.c (webp_load): Work around a (wrong) compiler warning in gcc 10.x (bug#52276). --- src/image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/image.c b/src/image.c index b85c405487f..709abc21aa0 100644 --- a/src/image.c +++ b/src/image.c @@ -8970,7 +8970,7 @@ webp_load (struct frame *f, struct image *img) { ptrdiff_t size = 0; uint8_t *contents; - Lisp_Object file; + Lisp_Object file = Qnil; /* Open the WebP file. */ Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); @@ -9007,7 +9007,7 @@ webp_load (struct frame *f, struct image *img) /* Validate the WebP image header. */ if (!WebPGetInfo (contents, size, NULL, NULL)) { - if (NILP (specified_data)) + if (! NILP (file)) image_error ("Not a WebP file: `%s'", file); else image_error ("Invalid header in WebP image data"); @@ -9030,7 +9030,7 @@ webp_load (struct frame *f, struct image *img) case VP8_STATUS_USER_ABORT: default: /* Error out in all other cases. */ - if (NILP (specified_data)) + if (! NILP (file)) image_error ("Error when interpreting WebP image data: `%s'", file); else image_error ("Error when interpreting WebP image data"); -- 2.39.2