Skip to content

Commit 8581594

Browse files
committed
Cast TickType_t to unsigned long when printing
Fixes Clang warnings of this type: > /source/FreeRTOS_DHCP.c:405:87: warning: format specifies type 'unsigned long' but the argument has type 'TickType_t' (aka 'unsigned int') [-Wformat] > 405 | FreeRTOS_debug_printf( ( "vDHCPProcess: timeout %lu ticks\n", EP_DHCPData.xDHCPTxPeriod ) ); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | %u > /source/FreeRTOS_DHCP.c:59:33: note: expanded from macro 'EP_DHCPData' > 59 | #define EP_DHCPData pxEndPoint->xDHCPData /**< Temporary define to make /single source similar to /multi version. */ > | ^ > /build/src/FreeRTOSIPConfig.h:60:12: note: expanded from macro 'FreeRTOS_debug_printf' > 60 | printf X > | ^
1 parent b23450c commit 8581594

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/FreeRTOS_DHCP.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402

403403
if( prvSendDHCPDiscover( pxEndPoint ) == pdPASS )
404404
{
405-
FreeRTOS_debug_printf( ( "vDHCPProcess: timeout %lu ticks\n", EP_DHCPData.xDHCPTxPeriod ) );
405+
FreeRTOS_debug_printf( ( "vDHCPProcess: timeout %lu ticks\n", ( unsigned long ) EP_DHCPData.xDHCPTxPeriod ) );
406406
}
407407
else
408408
{
@@ -419,7 +419,7 @@
419419
}
420420
else
421421
{
422-
FreeRTOS_debug_printf( ( "vDHCPProcess: giving up %lu > %lu ticks\n", EP_DHCPData.xDHCPTxPeriod, ipconfigMAXIMUM_DISCOVER_TX_PERIOD ) );
422+
FreeRTOS_debug_printf( ( "vDHCPProcess: giving up %lu > %lu ticks\n", ( unsigned long ) EP_DHCPData.xDHCPTxPeriod, ( unsigned long ) ipconfigMAXIMUM_DISCOVER_TX_PERIOD ) );
423423

424424
#if ( ipconfigDHCP_FALL_BACK_AUTO_IP != 0 )
425425
{
@@ -950,7 +950,7 @@
950950

951951
/* Create the DHCP socket if it has not already been created. */
952952
prvCreateDHCPSocket( pxEndPoint );
953-
FreeRTOS_debug_printf( ( "prvInitialiseDHCP: start after %lu ticks\n", dhcpINITIAL_TIMER_PERIOD ) );
953+
FreeRTOS_debug_printf( ( "prvInitialiseDHCP: start after %lu ticks\n", ( unsigned long ) dhcpINITIAL_TIMER_PERIOD ) );
954954
vDHCP_RATimerReload( pxEndPoint, dhcpINITIAL_TIMER_PERIOD );
955955
}
956956
else

source/FreeRTOS_IP_Timers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static void prvIPTimerReload( IPTimer_t * pxTimer,
522522
void vDHCP_RATimerReload( NetworkEndPoint_t * pxEndPoint,
523523
TickType_t uxClockTicks )
524524
{
525-
FreeRTOS_printf( ( "vDHCP_RATimerReload: %lu\n", uxClockTicks ) );
525+
FreeRTOS_printf( ( "vDHCP_RATimerReload: %lu\n", ( unsigned long ) uxClockTicks ) );
526526
prvIPTimerReload( &( pxEndPoint->xDHCP_RATimer ), uxClockTicks );
527527
}
528528
#endif /* ( ipconfigUSE_DHCP == 1 ) || ( ipconfigUSE_RA == 1 ) */

0 commit comments

Comments
 (0)