Skip to content

Commit b95e645

Browse files
committed
Print ntohl() using %l
ntohl() returns a u32, which is defined as an unsigned long in GCC. > /source/FreeRTOS_IPv4.c:442:52: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat=-Wformat=8;;] > 442 | FreeRTOS_printf( ( "prvAllowIPPacket: UDP packet from %xip without CRC dropped\n", > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /build/src/FreeRTOSIPConfig.h:75:12: note: in definition of macro 'FreeRTOS_printf' > 75 | printf X > | ^ > /source/FreeRTOS_IPv4.c:442:88: note: format string is defined here > 442 | FreeRTOS_printf( ( "prvAllowIPPacket: UDP packet from %xip without CRC dropped\n", > | ~^ > | | > | unsigned int > | %lx
1 parent 527a7c9 commit b95e645

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/FreeRTOS_IPv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * cons
439439
/* Exclude this from branch coverage as this is only used for debugging. */
440440
if( xCount < 5 ) /* LCOV_EXCL_BR_LINE */
441441
{
442-
FreeRTOS_printf( ( "prvAllowIPPacket: UDP packet from %xip without CRC dropped\n",
442+
FreeRTOS_printf( ( "prvAllowIPPacket: UDP packet from %lxip without CRC dropped\n",
443443
FreeRTOS_ntohl( pxIPPacket->xIPHeader.ulSourceIPAddress ) ) );
444444
xCount++;
445445
}

0 commit comments

Comments
 (0)