From ecff219e6fef45ca2d39189c3f633745b1abf8ec Mon Sep 17 00:00:00 2001 From: Simon Butcher Date: Wed, 3 Oct 2018 16:17:41 +0100 Subject: [PATCH] Change file scoping of test helpers.function Dependent on configured options, not all of the helper functions were being used, which was leading to warning of unused functions with Clang. To avoid any complex compile time options, or adding more logic to generate_test_code.py to screen out unused functions, those functions which were provoking the warning were changed to remove static, remove them from file scope, and expose them to the linker. --- tests/suites/helpers.function | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 2e227f02c..580b4aba4 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -278,7 +278,7 @@ jmp_buf jmp_tmp; /*----------------------------------------------------------------------------*/ /* Helper Functions */ -static void test_fail( const char *test, int line_no, const char* filename ) +void test_fail( const char *test, int line_no, const char* filename ) { test_info.failed = 1; test_info.test = test; @@ -368,7 +368,7 @@ static void close_output( FILE* out_stream ) } #endif /* __unix__ || __APPLE__ __MACH__ */ -static int unhexify( unsigned char *obuf, const char *ibuf ) +int unhexify( unsigned char *obuf, const char *ibuf ) { unsigned char c, c2; int len = strlen( ibuf ) / 2; @@ -402,7 +402,7 @@ static int unhexify( unsigned char *obuf, const char *ibuf ) return len; } -static void hexify( unsigned char *obuf, const unsigned char *ibuf, int len ) +void hexify( unsigned char *obuf, const unsigned char *ibuf, int len ) { unsigned char l, h; @@ -456,7 +456,7 @@ static unsigned char *zero_alloc( size_t len ) * * For convenience, dies if allocation fails. */ -static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen ) +unsigned char *unhexify_alloc( const char *ibuf, size_t *olen ) { unsigned char *obuf; @@ -507,7 +507,7 @@ static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len ) * * rng_state shall be NULL. */ -static int rnd_zero_rand( void *rng_state, unsigned char *output, size_t len ) +int rnd_zero_rand( void *rng_state, unsigned char *output, size_t len ) { if( rng_state != NULL ) rng_state = NULL; @@ -534,7 +534,7 @@ typedef struct * * After the buffer is empty it will return rand(); */ -static int rnd_buffer_rand( void *rng_state, unsigned char *output, size_t len ) +int rnd_buffer_rand( void *rng_state, unsigned char *output, size_t len ) { rnd_buf_info *info = (rnd_buf_info *) rng_state; size_t use_len; @@ -580,7 +580,7 @@ typedef struct * * rng_state shall be a pointer to a rnd_pseudo_info structure. */ -static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len ) +int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len ) { rnd_pseudo_info *info = (rnd_pseudo_info *) rng_state; uint32_t i, *k, sum, delta=0x9E3779B9;