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 <rodrigo@correas.us>
This commit is contained in:
parent
2c424570e2
commit
80448aae2c
2 changed files with 2 additions and 2 deletions
|
@ -158,7 +158,7 @@ static int calloc_self_test( int verbose )
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SELF_TEST */
|
#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;
|
int ret;
|
||||||
char buf[10] = "xxxxxxxxx";
|
char buf[10] = "xxxxxxxxx";
|
||||||
|
|
|
@ -335,7 +335,7 @@ static int convert_params( size_t cnt , char ** params , int * int_params_store
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
__attribute__((__noinline__))
|
__attribute__((__noinline__))
|
||||||
#endif
|
#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;
|
int ret;
|
||||||
char buf[10] = "xxxxxxxxx";
|
char buf[10] = "xxxxxxxxx";
|
||||||
|
|
Loading…
Reference in a new issue