Merge bitcoin-core/secp256k1#1244: Suppress `-Wunused-parameter` when building for coverage analysis
5bb03c2911
Replace `SECP256K1_ECMULT_TABLE_VERIFY` macro by a function (Hennadii Stepanov)4429a8c218
Suppress `-Wunused-parameter` when building for coverage analysis (Hennadii Stepanov) Pull request description: ACKs for top commit: real-or-random: utACK5bb03c2911
jonasnick: ACK5bb03c2911
Tree-SHA512: 19a395434ecefea201a03fc45b3f0b88f1520908926ac1207bbc6570034b1141b49c3c98e66819dcd9069dfdd28c7c6fbe957f13fb6bd178fd57ce65bfbb8fbd
This commit is contained in:
commit
afd8b23b27
|
@ -147,7 +147,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Define custom "Coverage" build type.
|
# Define custom "Coverage" build type.
|
||||||
set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0 -DCOVERAGE=1 --coverage -Wno-unused-parameter" CACHE STRING
|
set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0 -DCOVERAGE=1 --coverage" CACHE STRING
|
||||||
"Flags used by the C compiler during \"Coverage\" builds."
|
"Flags used by the C compiler during \"Coverage\" builds."
|
||||||
FORCE
|
FORCE
|
||||||
)
|
)
|
||||||
|
|
|
@ -114,13 +114,16 @@ static void secp256k1_ecmult_odd_multiples_table(int n, secp256k1_ge *pre_a, sec
|
||||||
secp256k1_fe_mul(z, &ai.z, &d.z);
|
secp256k1_fe_mul(z, &ai.z, &d.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SECP256K1_ECMULT_TABLE_VERIFY(n,w) \
|
SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
|
||||||
VERIFY_CHECK(((n) & 1) == 1); \
|
(void)n;
|
||||||
VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \
|
(void)w;
|
||||||
|
VERIFY_CHECK(((n) & 1) == 1);
|
||||||
|
VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
|
||||||
VERIFY_CHECK((n) <= ((1 << ((w)-1)) - 1));
|
VERIFY_CHECK((n) <= ((1 << ((w)-1)) - 1));
|
||||||
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
|
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
|
||||||
SECP256K1_ECMULT_TABLE_VERIFY(n,w)
|
secp256k1_ecmult_table_verify(n,w);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
*r = pre[(n-1)/2];
|
*r = pre[(n-1)/2];
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,7 +133,7 @@ SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_lambda(secp256k1_ge *r, const secp256k1_ge *pre, const secp256k1_fe *x, int n, int w) {
|
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_lambda(secp256k1_ge *r, const secp256k1_ge *pre, const secp256k1_fe *x, int n, int w) {
|
||||||
SECP256K1_ECMULT_TABLE_VERIFY(n,w)
|
secp256k1_ecmult_table_verify(n,w);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
secp256k1_ge_set_xy(r, &x[(n-1)/2], &pre[(n-1)/2].y);
|
secp256k1_ge_set_xy(r, &x[(n-1)/2], &pre[(n-1)/2].y);
|
||||||
} else {
|
} else {
|
||||||
|
@ -140,7 +143,7 @@ SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_lambda(secp256k1_ge *
|
||||||
}
|
}
|
||||||
|
|
||||||
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
|
SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
|
||||||
SECP256K1_ECMULT_TABLE_VERIFY(n,w)
|
secp256k1_ecmult_table_verify(n,w);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
|
secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue