unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] * image.c: Fix compiler warning due to missing const
@ 2015-09-10  3:38 Mitchel Humpherys
  2015-09-10  9:52 ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: Mitchel Humpherys @ 2015-09-10  3:38 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mitchel Humpherys

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",
-- 
2.5.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-10 18:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-10  3:38 [PATCH] * image.c: Fix compiler warning due to missing const Mitchel Humpherys
2015-09-10  9:52 ` Paul Eggert
2015-09-10 15:38   ` Eli Zaretskii
2015-09-10 15:49     ` Mitchel Humpherys
2015-09-10 15:58       ` Eli Zaretskii
2015-09-10 18:25       ` Paul Eggert
2015-09-10 18:56         ` Eli Zaretskii

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).