Closes #51 as well.
Fix signedness mistakes in secp256k1_num_set_hex #56
pull sipa wants to merge 1 commits into bitcoin-core:master from sipa:fixsign changing 1 files +1 −1-
sipa commented at 1:43 PM on August 26, 2014: contributor
- sipa renamed this:
Fix some signedness mistakes in secp256k1_num_set_hex
Fix signedness mistakes in secp256k1_num_set_hex
on Aug 26, 2014 - sipa cross-referenced this on Aug 26, 2014 from issue fix unsigned warning in num_gmp_impl.h by caktux
-
caktux commented at 5:09 PM on August 26, 2014: contributor
This does not fix the warning, casting to unsigned later or declaring as unsigned while assigning to signed is the same mistake. Here the type passed to mpn_set_str is unsigned char*.
.../secp256k1/impl/num_gmp.h:286:37: warning: passing 'char [257]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] r->limbs = mpn_set_str(r->data, num, alen, 16); ^~~ /usr/local/include/gmp.h:1585:68: note: passing argument to parameter here __GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int); ^ -
sipa commented at 11:16 PM on August 26, 2014: contributor
You're right. I found some online documentation that declared it as const char_, but it seems my version here also uses const unsigned char_.
-
fa492f059d
Fix a signedness mistake in secp256k1_num_set_hex
We were using a potentially signed char as index in an array.
- sipa force-pushed on Aug 26, 2014
- sipa merged this on Aug 28, 2014
- sipa closed this on Aug 28, 2014
- sipa referenced this in commit d531b04ea9 on Aug 28, 2014
- real-or-random referenced this in commit acc62885b5 on May 31, 2019