[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * image.c: Fix compiler warning due to missing const

From: Mitchel Humpherys
Subject: [PATCH] * image.c: Fix compiler warning due to missing const
Date: Wed, 9 Sep 2015 20:38:23 -0700

The `GifErrorString' function from gif_lib has returned a `const char *'
since gif_lib commit [95f5da16b9a134e5706d54e8725413625c3b745d:
"Compiler waening cleanup."].  We currently store the return value in a
`char *', which results in the following compiler warning:

    image.c: In function ‘gif_load’:
    image.c:7984:26: warning: initialization discards ‘const’ qualifier from \
       pointer target type [-Wdiscarded-qualifiers]
           char *error_text = GifErrorString (gif_err);

Fix this.
 src/image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/image.c b/src/image.c
index 85cf801f6a..f9d0df7626 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7981,7 +7981,7 @@ gif_load (struct frame *f, struct image *img)
   if (gif_close (gif, &gif_err) == GIF_ERROR)
 #if 5 <= GIFLIB_MAJOR
-      char *error_text = GifErrorString (gif_err);
+      const char *error_text = GifErrorString (gif_err);
       if (error_text)
        image_error ("Error closing `%s': %s",

reply via email to

[Prev in Thread] Current Thread [Next in Thread]