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>
+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
switch (mode)
{
- case 0:
+ case GC_NULL:
gcrymode = 0;
break;
enum Gc_hash_mode
{
- GC_HMAC = 1
+ GC_NULL,
+ GC_HMAC
};
typedef enum Gc_hash_mode Gc_hash_mode;