From 7a59f71af83e8024a9b298cc5eb70ca016ef00e9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Aug 2017 18:02:58 +0200 Subject: [PATCH] fix warning warning: 'ltc_asn1_type {aka enum ltc_asn1_type_}' is promoted to 'int' when passed through '...' type = va_arg(args, ltc_asn1_type); note: (so you should pass 'int' not 'ltc_asn1_type {aka enum ltc_asn1_type_}' to 'va_arg') note: if this code is reached, the program will abort --- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 4 ++-- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 4c943a7..1361b76 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -39,7 +39,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); LTC_UNUSED_PARAM(size); @@ -94,7 +94,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 0f3506e..c1b40c7 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -40,7 +40,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); LTC_UNUSED_PARAM(size); @@ -95,7 +95,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*);