From 80448aae2c93b7bfe73a05410196e237ef2dd8e1 Mon Sep 17 00:00:00 2001 From: Rodrigo Dias Correa Date: Tue, 10 Nov 2020 02:28:50 -0300 Subject: [PATCH] Fix GCC warning about `test_snprintf` GCC 11 generated the warnings because the parameter `ret_buf` was declared as `const char[10]`, but some of the arguments provided in `run_test_snprintf` are shorter literals, like "". Now the type of `ret_buf` is `const char *`. Both implementations of `test_snprintf` were fixed. Signed-off-by: Rodrigo Dias Correa --- programs/test/selftest.c | 2 +- tests/suites/host_test.function | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/test/selftest.c b/programs/test/selftest.c index 2aa379b1c..41d704073 100644 --- a/programs/test/selftest.c +++ b/programs/test/selftest.c @@ -158,7 +158,7 @@ static int calloc_self_test( int verbose ) } #endif /* MBEDTLS_SELF_TEST */ -static int test_snprintf( size_t n, const char ref_buf[10], int ref_ret ) +static int test_snprintf( size_t n, const char *ref_buf, int ref_ret ) { int ret; char buf[10] = "xxxxxxxxx"; diff --git a/tests/suites/host_test.function b/tests/suites/host_test.function index db53e9784..872a3a43a 100644 --- a/tests/suites/host_test.function +++ b/tests/suites/host_test.function @@ -335,7 +335,7 @@ static int convert_params( size_t cnt , char ** params , int * int_params_store #if defined(__GNUC__) __attribute__((__noinline__)) #endif -static int test_snprintf( size_t n, const char ref_buf[10], int ref_ret ) +static int test_snprintf( size_t n, const char *ref_buf, int ref_ret ) { int ret; char buf[10] = "xxxxxxxxx";