From 47cd121d1890bb5c40b4dc5076a1b8c2ba2ee303 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 18 May 2021 16:39:33 +0200 Subject: [PATCH] Fix build error when int32_t is not int Fix a pointer mismatch when int32_t is not int, for example on Cortex-M where in32_t is long int. Fix #4530 Signed-off-by: Gilles Peskine --- ChangeLog.d/host_test-int32.txt | 3 +++ tests/suites/host_test.function | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 ChangeLog.d/host_test-int32.txt diff --git a/ChangeLog.d/host_test-int32.txt b/ChangeLog.d/host_test-int32.txt new file mode 100644 index 000000000..60ef8e970 --- /dev/null +++ b/ChangeLog.d/host_test-int32.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix test suite code on platforms where int32_t is not int, such as + Arm Cortex-M. Fixes #4530. diff --git a/tests/suites/host_test.function b/tests/suites/host_test.function index d83d751ec..a5fd7179b 100644 --- a/tests/suites/host_test.function +++ b/tests/suites/host_test.function @@ -33,7 +33,7 @@ int verify_string( char **str ) * * \return 0 if success else 1 */ -int verify_int( char *str, int *value ) +int verify_int( char *str, int32_t *value ) { size_t i; int minus = 0; @@ -238,7 +238,7 @@ static int parse_arguments( char *buf, size_t len, char **params, * * \return 0 for success else 1 */ -static int convert_params( size_t cnt , char ** params , int * int_params_store ) +static int convert_params( size_t cnt , char ** params , int32_t * int_params_store ) { char ** cur = params; char ** out = params; @@ -520,7 +520,7 @@ int execute_tests( int argc , const char ** argv ) char buf[5000]; char *params[50]; /* Store for proccessed integer params. */ - int int_params[50]; + int32_t int_params[50]; void *pointer; #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) int stdout_fd = -1;