Fail for types not of size 2, 4 or 8
@@ -383,6 +383,8 @@ int main( int argc, char *argv[] )
#define CHECK_PADDING_SIGNED(TYPE, NAME) \
do \
{ \
+ if( sizeof( TYPE ) == 2 || sizeof( TYPE ) == 4 || \
+ sizeof( TYPE ) == 8 ) { \
if( ( sizeof( TYPE ) == 2 && \
(int16_t) NAME ## _MAX != 0x7FFF ) || \
( sizeof( TYPE ) == 4 && \
@@ -393,6 +395,12 @@ int main( int argc, char *argv[] )
mbedtls_printf( "Type '" #TYPE "' has padding bits\n" );\
mbedtls_exit( MBEDTLS_EXIT_FAILURE ); \
} \
+ } else { \
+ mbedtls_printf( "Padding checks only implemented for types of size 2, 4 or 8" \
+ " - cannot check type '" #TYPE "' of size %ld\n", \
+ sizeof( TYPE ) ); \
+ mbedtls_exit( MBEDTLS_EXIT_FAILURE ); \
+ } \
} while( 0 )
#define CHECK_PADDING_UNSIGNED(TYPE, NAME) \
