From d74bceda9ab35e2eb137c2bc0f27690355a273b0 Mon Sep 17 00:00:00 2001 From: "Diego F. Aranha" Date: Wed, 8 May 2024 23:01:29 +0200 Subject: [PATCH] Remove more compiler warnings. --- CMakeLists.txt | 4 ++-- src/ep/relic_ep_map.c | 4 ++-- src/epx/relic_ep2_map.c | 2 +- src/epx/relic_ep3_curve.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc41cbc8d..1cc0ed7f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,14 +247,14 @@ if("$ENV{CFLAGS}" STREQUAL "") set(CFLAGS "/Od" CACHE STRING "Default compiler flags.") else() # Turn off all optimizations. - set(CFLAGS "-pipe -std=c99 -O0 -fno-omit-frame-pointer" CACHE STRING "Default compiler flags.") + set(CFLAGS "-pipe -std=c99 -O0 -fno-omit-frame-pointer -Wno-stringop-overflow -Wno-stringop-overread" CACHE STRING "Default compiler flags.") set(DFLAGS "-ggdb") endif() else() if (MSVC) set(CFLAGS "/O2" CACHE STRING "Default compiler flags.") else() - set(CFLAGS "-pipe -std=c99 -O2 -funroll-loops -fomit-frame-pointer" CACHE STRING "Default compiler flags.") + set(CFLAGS "-pipe -std=c99 -O2 -funroll-loops -fomit-frame-pointer -Wno-stringop-overflow -Wno-stringop-overread" CACHE STRING "Default compiler flags.") endif() endif() else() diff --git a/src/ep/relic_ep_map.c b/src/ep/relic_ep_map.c index 3879e7444..fb923a61e 100644 --- a/src/ep/relic_ep_map.c +++ b/src/ep/relic_ep_map.c @@ -83,7 +83,7 @@ TMPL_MAP_SVDW(ep, fp, dig_t); * @param[in] map_fn - the mapping function. */ static void ep_map_from_field(ep_t p, const uint8_t *uniform_bytes, size_t len, - const void (*const map_fn)(ep_t, const fp_t)) { + void (*const map_fn)(ep_t, const fp_t)) { bn_t k; fp_t t; ep_t q; @@ -219,7 +219,7 @@ void ep_map_sswum(ep_t p, const uint8_t *msg, size_t len) { /* figure out which hash function to use */ const int abNeq0 = (ep_curve_opt_a() != RLC_ZERO) && (ep_curve_opt_b() != RLC_ZERO); - const void (*const map_fn)(ep_t, const fp_t) = (void (*const)) + void (*const map_fn)(ep_t, const fp_t) = (ep_curve_is_ctmap() || abNeq0 ? ep_map_sswu : ep_map_svdw); ep_map_from_field(p, r, 2 * elm, map_fn); } diff --git a/src/epx/relic_ep2_map.c b/src/epx/relic_ep2_map.c index 2445deed3..a99998f8b 100644 --- a/src/epx/relic_ep2_map.c +++ b/src/epx/relic_ep2_map.c @@ -113,7 +113,7 @@ static void ep2_map_from_field(ep2_t p, const uint8_t *r, size_t len) { /* which hash function should we use? */ const int abNeq0 = (ep2_curve_opt_a() != RLC_ZERO) && (ep2_curve_opt_b() != RLC_ZERO); - const void (*const map_fn)(ep2_t, fp2_t) = (void (*const)) + void (*const map_fn)(ep2_t, fp2_t) = (void (*const)) (ep2_curve_is_ctmap() || abNeq0 ? ep2_map_sswu : ep2_map_svdw); #define EP2_MAP_CONVERT_BYTES(IDX) \ diff --git a/src/epx/relic_ep3_curve.c b/src/epx/relic_ep3_curve.c index ff9ba52a1..f80a56406 100644 --- a/src/epx/relic_ep3_curve.c +++ b/src/epx/relic_ep3_curve.c @@ -255,7 +255,7 @@ void ep3_curve_mul_a(fp3_t c, const fp3_t a) { break; #if FP_RDC != MONTY case RLC_TINY: - fp3_mul_dig(c, a, ctx->ep3_a[0]); + fp3_mul_dig(c, a, ctx->ep3_a[0][0]); break; #endif default: @@ -275,7 +275,7 @@ void ep3_curve_mul_b(fp3_t c, const fp3_t a) { break; #if FP_RDC != MONTY case RLC_TINY: - fp3_mul_dig(c, a, ctx->ep3_b[0]); + fp3_mul_dig(c, a, ctx->ep3_b[0][0]); break; #endif default: