@@ -31,15 +31,6 @@ This library provides single precision (SP) integer math functions.
3131
3232#if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)
3333
34- #ifdef WOLFSSL_SP_DYN_STACK
35- /* We are statically declaring a variable smaller than sp_int.
36- * We track available memory in the 'size' field.
37- * Disable warnings of sp_int being partly outside array bounds of variable.
38- */
39- PRAGMA_GCC_DIAG_PUSH
40- PRAGMA_GCC("GCC diagnostic ignored \"-Warray-bounds\"")
41- #endif
42-
4334#ifdef NO_INLINE
4435 #include <wolfssl/wolfcrypt/misc.h>
4536#else
@@ -94,7 +85,7 @@ This library provides single precision (SP) integer math functions.
9485 * WOLFSSL_SP_INT_NEGATIVE Enables negative values to be used.
9586 * WOLFSSL_SP_INT_DIGIT_ALIGN Enable when unaligned access of sp_int_digit
9687 * pointer is not allowed.
97- * WOLFSSL_SP_DYN_STACK Enable use of dynamic stack items.
88+ * WOLFSSL_SP_NO_DYN_STACK Disable use of dynamic stack items.
9889 * Dynamic arrays used when not small stack.
9990 * WOLFSSL_SP_FAST_MODEXP Allow fast mod_exp with small C code
10091 * WOLFSSL_SP_LOW_MEM Use algorithms that use less memory.
@@ -108,6 +99,15 @@ This library provides single precision (SP) integer math functions.
10899
109100#include <wolfssl/wolfcrypt/sp_int.h>
110101
102+ #ifdef WOLFSSL_SP_DYN_STACK
103+ /* We are statically declaring a variable smaller than sp_int.
104+ * We track available memory in the 'size' field.
105+ * Disable warnings of sp_int being partly outside array bounds of variable.
106+ */
107+ PRAGMA_GCC_DIAG_PUSH
108+ PRAGMA_GCC("GCC diagnostic ignored \"-Warray-bounds\"")
109+ #endif
110+
111111#if defined(WOLFSSL_LINUXKM) && !defined(WOLFSSL_SP_ASM)
112112 /* force off unneeded vector register save/restore. */
113113 #undef SAVE_VECTOR_REGISTERS
0 commit comments