From 7f25dd05148022a368a88ebef0267046ce17c21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 1 Mar 2019 11:57:34 +0100 Subject: [PATCH] zephyr: Fix bug where prototype of SNPRINTF was not declared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #10990. A warning is triggered when snprintf is used because it is being declared / configured incorrectly. The MBEDTLS configuration is defaulting to disabling all of LIBC, and then explicitly enabling the LIBC functions in use, this has been done for printf with MBEDTLS_PLATFORM_STD_PRINTF, but not for MBEDTLS_PLATFORM_STD_SNPRINTF. Signed-off-by: Sebastian Bøe --- boot/zephyr/include/config-kw.h | 1 + boot/zephyr/include/config-rsa-kw.h | 1 + boot/zephyr/include/config-rsa.h | 1 + 3 files changed, 3 insertions(+) diff --git a/boot/zephyr/include/config-kw.h b/boot/zephyr/include/config-kw.h index 8ff31aee2e..8e55b9eee5 100644 --- a/boot/zephyr/include/config-kw.h +++ b/boot/zephyr/include/config-kw.h @@ -43,6 +43,7 @@ #define MBEDTLS_NO_PLATFORM_ENTROPY #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES #define MBEDTLS_PLATFORM_PRINTF_ALT +#define MBEDTLS_PLATFORM_SNPRINTF_ALT #define MBEDTLS_ASN1_PARSE_C diff --git a/boot/zephyr/include/config-rsa-kw.h b/boot/zephyr/include/config-rsa-kw.h index 3568cc01c5..5c253e4c3a 100644 --- a/boot/zephyr/include/config-rsa-kw.h +++ b/boot/zephyr/include/config-rsa-kw.h @@ -43,6 +43,7 @@ #define MBEDTLS_NO_PLATFORM_ENTROPY #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES #define MBEDTLS_PLATFORM_PRINTF_ALT +#define MBEDTLS_PLATFORM_SNPRINTF_ALT #if !defined(CONFIG_ARM) #define MBEDTLS_HAVE_ASM diff --git a/boot/zephyr/include/config-rsa.h b/boot/zephyr/include/config-rsa.h index d27acf9b5e..31f01666fe 100644 --- a/boot/zephyr/include/config-rsa.h +++ b/boot/zephyr/include/config-rsa.h @@ -43,6 +43,7 @@ #define MBEDTLS_NO_PLATFORM_ENTROPY #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES #define MBEDTLS_PLATFORM_PRINTF_ALT +#define MBEDTLS_PLATFORM_SNPRINTF_ALT #if !defined(CONFIG_ARM) #define MBEDTLS_HAVE_ASM