When building with clang and the -Wshorten-64-to-32
flag, there are some warnings:
0In file included from /home/hebasto/git/secp256k1/secp256k1/src/secp256k1.c:27:
1In file included from /home/hebasto/git/secp256k1/secp256k1/src/field_impl.h:14:
2In file included from /home/hebasto/git/secp256k1/secp256k1/src/field_5x52_impl.h:13:
3/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:279:39: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
4 279 | w = (f * g * (f * f - 2)) & m;
5 | ~ ~~~~~~~~~~~~~~~~~~~~~~^~~
6/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:289:19: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
7 289 | w = f + (((f + 1) & 4) << 1);
8 | ~ ~~^~~~~~~~~~~~~~~~~~~~~~
9/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:290:26: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
10 290 | w = (-w * g) & m;
11 | ~ ~~~~~~~~~^~~
12/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:370:39: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
13 370 | w = (f * g * (f * f - 2)) & m;
14 | ~ ~~~~~~~~~~~~~~~~~~~~~~^~~
15/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:380:19: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
16 380 | w = f + (((f + 1) & 4) << 1);
17 | ~ ~~^~~~~~~~~~~~~~~~~~~~~~
18/home/hebasto/git/secp256k1/secp256k1/src/modinv64_impl.h:381:26: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
19 381 | w = (-w * g) & m;
20 | ~ ~~~~~~~~~^~~
21In file included from /home/hebasto/git/secp256k1/secp256k1/src/secp256k1.c:28:
22In file included from /home/hebasto/git/secp256k1/secp256k1/src/scalar_impl.h:20:
23/home/hebasto/git/secp256k1/secp256k1/src/scalar_4x64_impl.h:119:42: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
24 119 | overflow = secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r);
25 | ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26/home/hebasto/git/secp256k1/secp256k1/src/scalar_4x64_impl.h:682:34: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
27 682 | secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));
28 | ~~~~~~~~~~~~~~~~~~~~~~~ ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29In file included from /home/hebasto/git/secp256k1/secp256k1/src/secp256k1.c:30:
30/home/hebasto/git/secp256k1/secp256k1/src/ecmult_impl.h:518:21: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
31 518 | for (i = n_wnaf - 1; i >= 0; i--) {
32 | ~ ~~~~~~~^~~
33/home/hebasto/git/secp256k1/secp256k1/src/ecmult_impl.h:562:52: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
34 562 | for(j = ECMULT_TABLE_SIZE(bucket_window+2) - 1; j > 0; j--) {
35 | ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
36In file included from /home/hebasto/git/secp256k1/secp256k1/src/secp256k1.c:32:
37In file included from /home/hebasto/git/secp256k1/secp256k1/src/ecmult_gen_impl.h:14:
38/home/hebasto/git/secp256k1/secp256k1/src/hash_impl.h:151:52: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
39 151 | secp256k1_write_be32(&sizedesc[0], hash->bytes >> 29);
40 | ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~^~~~~
41/home/hebasto/git/secp256k1/secp256k1/src/hash_impl.h:152:52: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
42 152 | secp256k1_write_be32(&sizedesc[4], hash->bytes << 3);
43 | ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~^~~~
44/home/hebasto/git/secp256k1/secp256k1/src/hash_impl.h:261:19: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
45 261 | int now = outlen;
46 | ~~~ ^~~~~~
4713 warnings generated.