[openssl-dev] [openssl.org #3993] [PATCH] Fix VS2008 "result still unsigned" build warning
David Woodhouse via RT
rt at openssl.org
Thu Aug 6 13:17:39 UTC 2015
When building with Visual Studio 2008, I get the following warning:
C4146: unary minus operator applied to unsigned type, result still unsigned
Fix it by casting to (int64_t) and *then* negating the value.
---
crypto/asn1/a_int.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c
index 0d020e0..5d5e7f6 100644
--- a/crypto/asn1/a_int.c
+++ b/crypto/asn1/a_int.c
@@ -338,7 +338,7 @@ static int asn1_get_int64(int64_t *pr, const unsigned char *b, size_t blen,
ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_SMALL);
return 0;
}
- *pr = (int64_t)-r;
+ *pr = -(int64_t)r;
} else {
if (r > INT64_MAX) {
ASN1err(ASN1_F_ASN1_GET_INT64, ASN1_R_TOO_LARGE);
--
2.4.3
--
David Woodhouse Open Source Technology Centre
David.Woodhouse at intel.com Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5691 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20150806/7196be64/attachment.bin>
-------------- next part --------------
_______________________________________________
openssl-bugs-mod mailing list
openssl-bugs-mod at openssl.org
https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod
More information about the openssl-dev
mailing list