unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mitchel Humpherys <mitch.special@gmail.com>
To: emacs-devel@gnu.org
Cc: Mitchel Humpherys <mitch.special@gmail.com>
Subject: [PATCH] * image.c: Fix compiler warning due to missing const
Date: Wed,  9 Sep 2015 20:38:23 -0700	[thread overview]
Message-ID: <1441856303-4171-1-git-send-email-mitch.special@gmail.com> (raw)

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




             reply	other threads:[~2015-09-10  3:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  3:38 Mitchel Humpherys [this message]
2015-09-10  9:52 ` [PATCH] * image.c: Fix compiler warning due to missing const 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

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=1441856303-4171-1-git-send-email-mitch.special@gmail.com \
    --to=mitch.special@gmail.com \
    --cc=emacs-devel@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).