]> Savannah Git Hosting - gnulib.git/commitdiff
gc-libgcrypt: fix assignment error due to -Werror=pointer-sign
authorJia Zhang <qianyue.zj@alibaba-inc.com>
Sat, 28 Oct 2017 06:16:08 +0000 (02:16 -0400)
committerBruno Haible <bruno@clisp.org>
Sat, 28 Oct 2017 12:38:59 +0000 (14:38 +0200)
Resolve the following build failure:
lib/gc-libgcrypt.c: In function 'gc_hash_read':
lib/gc-libgcrypt.c:460:14: error: pointer targets in assignment differ
in signedness [-Werror=pointer-sign]
       digest = gcry_md_read (ctx->gch, 0);
              ^

* lib/gc-libgcrypt.c (gc_hash_read): Cast result of gcry_md_read.

Signed-off-by: Jia Zhang <qianyue.zj@alibaba-inc.com>
ChangeLog
lib/gc-libgcrypt.c

index 7ce63c22f7e174136694d75ecf0e1f74004c1aec..7191bd018bdae9e597fe5d5b2f8a8b7021285bfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-10-28  Jia Zhang  <qianyue.zj@alibaba-inc.com>
+
+       gc-libgcrypt: fix assignment error due to -Werror=pointer-sign
+       Resolve the following build failure:
+       lib/gc-libgcrypt.c: In function 'gc_hash_read':
+       lib/gc-libgcrypt.c:460:14: error: pointer targets in assignment differ
+       in signedness [-Werror=pointer-sign]
+           digest = gcry_md_read (ctx->gch, 0);
+                  ^
+       * lib/gc-libgcrypt.c (gc_hash_read): Cast result of gcry_md_read.
+
 2017-10-26  Bruno Haible  <bruno@clisp.org>
 
        havelib: Fix value of LD for 32-bit compilation on NetBSD/sparc64.
index 56150c4f6c56167032b5b81256b3c2635d2c0aad..968b599926cb19ec5f81c7cad92cfd386c42834c 100644 (file)
@@ -449,7 +449,7 @@ gc_hash_read (gc_hash_handle handle)
 #endif
     {
       gcry_md_final (ctx->gch);
-      digest = gcry_md_read (ctx->gch, 0);
+      digest = (const char *) gcry_md_read (ctx->gch, 0);
     }
 
   return digest;