Fix IAR Warnings
IAR was warning that conditional execution could bypass initialisation of
variables, although those same variables were not used uninitialised.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/ChangeLog.d/fix-iar-warnings.txt b/ChangeLog.d/fix-iar-warnings.txt
index 244e863..8a30132 100644
--- a/ChangeLog.d/fix-iar-warnings.txt
+++ b/ChangeLog.d/fix-iar-warnings.txt
@@ -1,2 +1,2 @@
Bugfix
- * Fix IAR compiler warnings. Contributed by Glenn Strauss in #3835.
+ * Fix IAR compiler warnings. Fixes #6924.
diff --git a/library/bignum.c b/library/bignum.c
index 41b3a26..d3a1b00 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1656,6 +1656,7 @@
size_t window_bitsize;
size_t i, j, nblimbs;
size_t bufsize, nbits;
+ size_t exponent_bits_in_window = 0;
mbedtls_mpi_uint ei, mm, state;
mbedtls_mpi RR, T, W[(size_t) 1 << MBEDTLS_MPI_WINDOW_SIZE], WW, Apos;
int neg;
@@ -1829,7 +1830,6 @@
nblimbs = E->n;
bufsize = 0;
nbits = 0;
- size_t exponent_bits_in_window = 0;
state = 0;
while (1) {