Use %zu to print sizeof(x) with printf
Commit Message
sizeof returns size_t (a unsigned integer with a high bit count) and has to be
printed with the prefix before length motifier.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
batman-experimental/control.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -57,7 +57,7 @@ void init_control( void ) {
// just to check if sizeof( struct xyz { char[] }__attribute__((packed)); ) is zero for all compilers...
if ( sizeof( struct cntl_msg ) != 20 ) {
- printf( "sizeof cntl_msg %d MUST BE 20 !!!\n", sizeof( struct cntl_msg ) );
+ printf( "sizeof cntl_msg %zu MUST BE 20 !!!\n", sizeof( struct cntl_msg ) );
exit(EXIT_FAILURE);
}