Skip to content

Commit

Permalink
Silence a warning from Clang >=15 about an unused local variable
Browse files Browse the repository at this point in the history
The assembly code uses t only on some architectures. Fixes #7166.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
  • Loading branch information
gilles-peskine-arm committed Feb 24, 2023
1 parent 809c3d5 commit d784833
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.d/clang-15-bignum-warning.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix
* Silence a warning about an unused local variable in bignum.c on
some architectures. Fixes #7166.
3 changes: 1 addition & 2 deletions library/bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,7 @@ void mpi_mul_hlp(size_t i,
mbedtls_mpi_uint b)
{
mbedtls_mpi_uint c = 0, t = 0;
(void) t; /* Unused in some architectures */

#if defined(MULADDC_HUIT)
for (; i >= 8; i -= 8) {
Expand Down Expand Up @@ -1472,8 +1473,6 @@ void mpi_mul_hlp(size_t i,
}
#endif /* MULADDC_HUIT */

t++;

while (c != 0) {
*d += c; c = (*d < c); d++;
}
Expand Down

0 comments on commit d784833

Please sign in to comment.