mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-06 14:38:57 +01:00
Fix const-ness in mbedtls_param_failed()
The previous prototype gave warnings are the strings produced by #cond and
__FILE__ are const, so we shouldn't implicitly cast them to non-const.
While at it modifying most example programs:
- include the header that has the function declaration, so that the definition
can be checked to match by the compiler
- fix whitespace
- make it work even if PLATFORM_C is not defined:
- CHECK_PARAMS is not documented as depending on PLATFORM_C and there is
no reason why it should
- so, remove the corresponding #if defined in each program...
- and add missing #defines for mbedtls_exit when needed
The result has been tested (make all test with -Werror) with the following
configurations:
- full with CHECK_PARAMS with PLATFORM_C
- full with CHECK_PARAMS without PLATFORM_C
- full without CHECK_PARAMS without PLATFORM_C
- full without CHECK_PARAMS with PLATFORM_C
Additionally, it has been manually tested that adding
mbedtls_aes_init( NULL );
near the normal call to mbedtls_aes_init() in programs/aes/aescrypt2.c has the
expected effect when running the program.
This commit is contained in:
parent
8e661bf6a8
commit
3ef6a6dc5c
48 changed files with 447 additions and 128 deletions
|
|
@ -287,7 +287,9 @@ static void platform_teardown()
|
|||
}
|
||||
|
||||
#if defined(MBEDTLS_CHECK_PARAMS)
|
||||
void mbedtls_param_failed( char* failure_condition, char* file, int line )
|
||||
void mbedtls_param_failed( const char *failure_condition,
|
||||
const char *file,
|
||||
int line )
|
||||
{
|
||||
/* If we are testing the callback function... */
|
||||
if ( test_info.paramfail_test_state == PARAMFAIL_TESTSTATE_PENDING )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue