Skip to content

Commit

Permalink
Fix #2573 - GCC build warning in tls_builtin.c::mul()
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Jan 20, 2024
1 parent a1c5995 commit f883504
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -9208,7 +9208,9 @@ static void sub(fe out, const fe a, const fe b) {
propagate(out, (limb_t) (1 + carry));
}

static void mul(fe out, const fe a, const fe b, unsigned nb) {
// `b` can contain less than 8 limbs, thus we use `limb_t *` instead of `fe`
// to avoid build warnings
static void mul(fe out, const fe a, const limb_t *b, unsigned nb) {
limb_t accum[2 * NLIMBS] = {0};
unsigned i, j;

Expand Down
4 changes: 3 additions & 1 deletion src/tls_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ static void sub(fe out, const fe a, const fe b) {
propagate(out, (limb_t) (1 + carry));
}

static void mul(fe out, const fe a, const fe b, unsigned nb) {
// `b` can contain less than 8 limbs, thus we use `limb_t *` instead of `fe`
// to avoid build warnings
static void mul(fe out, const fe a, const limb_t *b, unsigned nb) {
limb_t accum[2 * NLIMBS] = {0};
unsigned i, j;

Expand Down

0 comments on commit f883504

Please sign in to comment.