summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJia Zhang <qianyue.zj@alibaba-inc.com>2017-10-28 02:14:01 -0400
committerBruno Haible <bruno@clisp.org>2017-10-28 14:42:40 +0200
commit038d1385d424bafab4c6e5e8305b6ed3121ef4e9 (patch)
treeaa9b058c43fbf83fbd93a841c3fe3ed6cf99a816
parent33a9adc3a26269f5e592eae88d718b730162d868 (diff)
downloadgnulib-038d1385d424bafab4c6e5e8305b6ed3121ef4e9.tar.gz
gc-libgcrypt: fix undefined enum type in switch statement
Resolve the following build failure: lib/gc-libgcrypt.c: In function 'gc_hash_open': lib/gc-libgcrypt.c:317:5: error: case value '0' not in enumerated type 'Gc_hash_mode {aka enum Gc_hash_mode}' [-Werror=switch] case 0: ^~~~ * lib/gc.h (enum Gc_hash_mode): Add value GC_NULL. * lib/gc-libgcrypt.c (gc_hash_open): Use this enum value instead of 0. Signed-off-by: Jia Zhang <qianyue.zj@alibaba-inc.com>
-rw-r--r--ChangeLog12
-rw-r--r--lib/gc-libgcrypt.c2
-rw-r--r--lib/gc.h3
3 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7191bd018b..2c6b8d16cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2017-10-28 Jia Zhang <qianyue.zj@alibaba-inc.com>
+ gc-libgcrypt: fix undefined enum type in switch statement
+ Resolve the following build failure:
+ lib/gc-libgcrypt.c: In function 'gc_hash_open':
+ lib/gc-libgcrypt.c:317:5: error: case value '0' not in enumerated type
+ 'Gc_hash_mode {aka enum Gc_hash_mode}' [-Werror=switch]
+ case 0:
+ ^~~~
+ * lib/gc.h (enum Gc_hash_mode): Add value GC_NULL.
+ * lib/gc-libgcrypt.c (gc_hash_open): Use this enum value instead of 0.
+
+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':
diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c
index 968b599926..f0c8d82293 100644
--- a/lib/gc-libgcrypt.c
+++ b/lib/gc-libgcrypt.c
@@ -310,7 +310,7 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
switch (mode)
{
- case 0:
+ case GC_NULL:
gcrymode = 0;
break;
diff --git a/lib/gc.h b/lib/gc.h
index 14f3e3c091..a47cc8d0e3 100644
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -53,7 +53,8 @@ typedef enum Gc_hash Gc_hash;
enum Gc_hash_mode
{
- GC_HMAC = 1
+ GC_NULL,
+ GC_HMAC
};
typedef enum Gc_hash_mode Gc_hash_mode;