From dcf1a059561543e07fa6a0e18e1983cfe1aa6901 Mon Sep 17 00:00:00 2001 From: cuiziwei Date: Wed, 24 Jan 2024 17:22:55 +0800 Subject: [PATCH] fix build warning to [-Wstringop-overflow=]. mbedtls/library/alignment.h:98:5: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=] 98 | memcpy(p, &x, sizeof(x)); | ^~~~~~~~~~~~~~~~~~~~~~~~ mbedtls/library/cmac.c: In function 'mbedtls_cipher_cmac_finish': mbedtls/library/cmac.c:288:19: note: at offset 20 into destination object 'M_last' of size 16 288 | unsigned char M_last[MBEDTLS_CIPHER_BLKSIZE_MAX]; | ^~~~~~ Signed-off-by: cuiziwei --- crypto/mbedtls/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/mbedtls/Makefile b/crypto/mbedtls/Makefile index 5e031ca52..400259dcd 100644 --- a/crypto/mbedtls/Makefile +++ b/crypto/mbedtls/Makefile @@ -48,6 +48,7 @@ mbedtls/library/bignum.c_CFLAGS += -fno-lto ifeq ($(CONFIG_FRAME_POINTER),y) ifeq ($(CONFIG_DEBUG_OPTLEVEL),"-O3") mbedtls/library/sha256.c_CFLAGS += -O2 + mbedtls/library/cmac.c_CFLAGS += -O2 endif endif