From 6be928e02f670e74fc662c9e1250d262a7f163bb Mon Sep 17 00:00:00 2001 From: Monika Date: Wed, 26 Jul 2023 21:23:46 +0530 Subject: [PATCH 1/8] CMAKe update --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cda568c28..b393c26ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,9 @@ add_compile_options( # Suppressions required to build clean with clang. $<$:-Wno-unused-macros> + $<$:-Wno-cast-qual> + $<$:-Wno-switch-enum> + $<$:-Wno-declaration-after-statement> $<$:-Wno-padded> $<$:-Wno-missing-variable-declarations> $<$:-Wno-covered-switch-default> From 32b2e45f522d7cd03a118f63a9b6553fdc653ef5 Mon Sep 17 00:00:00 2001 From: Monika Date: Wed, 26 Jul 2023 09:08:07 +0530 Subject: [PATCH 2/8] Fix Wdocumentation errors --- source/FreeRTOS_ARP.c | 4 ++-- source/FreeRTOS_BitConfig.c | 6 +++--- source/FreeRTOS_DHCPv6.c | 10 +++++----- source/FreeRTOS_Sockets.c | 2 -- source/FreeRTOS_TCP_Utils.c | 1 - 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/source/FreeRTOS_ARP.c b/source/FreeRTOS_ARP.c index 330d11ab9..dc52b9fe8 100644 --- a/source/FreeRTOS_ARP.c +++ b/source/FreeRTOS_ARP.c @@ -637,8 +637,8 @@ BaseType_t xCheckRequiresARPResolution( const NetworkBufferDescriptor_t * pxNetw * @brief Look for an IP-MAC couple in ARP cache and reset the 'age' field. If no match * is found then no action will be taken. * - * @param[in] pxMACAddress: Pointer to the MAC address whose entry needs to be updated. - * @param[in] ulIPAddress: the IP address whose corresponding entry needs to be updated. + * @param[in] pxMACAddress Pointer to the MAC address whose entry needs to be updated. + * @param[in] ulIPAddress the IP address whose corresponding entry needs to be updated. */ void vARPRefreshCacheEntryAge( const MACAddress_t * pxMACAddress, const uint32_t ulIPAddress ) diff --git a/source/FreeRTOS_BitConfig.c b/source/FreeRTOS_BitConfig.c index f338891a4..515b8770d 100644 --- a/source/FreeRTOS_BitConfig.c +++ b/source/FreeRTOS_BitConfig.c @@ -132,9 +132,9 @@ BaseType_t xBitConfig_read_uc( BitConfig_t * pxConfig, /** * @brief Peek the last byte from a bit-config struct. * - * @param[in] pxConfig: The structure containing a copy of the bits. - * @param[in] pucData: The buffer to stored peeked data. - * @param[in] uxSize: The length of the binary data stream. + * @param[in] pxConfig The structure containing a copy of the bits. + * @param[in] pucData The buffer to stored peeked data. + * @param[in] uxSize The length of the binary data stream. * * @return pdTRUE if the malloc was OK, otherwise pdFALSE. */ diff --git a/source/FreeRTOS_DHCPv6.c b/source/FreeRTOS_DHCPv6.c index 8157fc96b..3c54d51fd 100644 --- a/source/FreeRTOS_DHCPv6.c +++ b/source/FreeRTOS_DHCPv6.c @@ -172,9 +172,9 @@ eDHCPState_t eGetDHCPv6State( struct xNetworkEndPoint * pxEndPoint ) /** * @brief Check if option length is less than buffer size and larger than minimum requirement. * - * @param[in] usOption: The option code. - * @param[in] uxOptionLength: The option length to check. - * @param[in] uxRemainingSize: Remaining size in the buffer. + * @param[in] usOption The option code. + * @param[in] uxOptionLength The option length to check. + * @param[in] uxRemainingSize Remaining size in the buffer. * * @return pdTRUE if the length is valid, otherwise pdFALSE. */ @@ -254,8 +254,8 @@ static BaseType_t prvIsOptionLengthValid( uint16_t usOption, /** * @brief A DHCP packet has a list of options, one of them is Status Code. This function is used to parse it. - * @param[in] uxLength: Total length for status code. - * @param[in] pxMessage: The raw packet as it was received. + * @param[in] uxLength Total length for status code. + * @param[in] pxMessage The raw packet as it was received. * * @return pdTRUE if status is success, otherwise pdFALSE. */ diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index 5900e4a2c..8d1d32f22 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -5764,8 +5764,6 @@ void * pvSocketGetSocketID( const ConstSocket_t xSocket ) * @brief A helper function of vTCPNetStat(), see below. * * @param[in] pxSocket The socket that needs logging. - * - * @return */ static void vTCPNetStat_TCPSocket( const FreeRTOS_Socket_t * pxSocket ) { diff --git a/source/FreeRTOS_TCP_Utils.c b/source/FreeRTOS_TCP_Utils.c index 2e6ecd2d6..425906e21 100644 --- a/source/FreeRTOS_TCP_Utils.c +++ b/source/FreeRTOS_TCP_Utils.c @@ -65,7 +65,6 @@ * * @return The string containing the flags. */ - static char retString[ 10 ]; const char * prvTCPFlagMeaning( UBaseType_t xFlags ) { size_t uxFlags = ( size_t ) xFlags; From 70273614d2ca26457ae1f91dc581699de1b6672a Mon Sep 17 00:00:00 2001 From: Monika Date: Wed, 26 Jul 2023 23:37:30 +0530 Subject: [PATCH 3/8] Fix Wconditional-uninitialized --- source/FreeRTOS_IP.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/FreeRTOS_IP.c b/source/FreeRTOS_IP.c index c860f1fc1..bc1a94a33 100644 --- a/source/FreeRTOS_IP.c +++ b/source/FreeRTOS_IP.c @@ -1789,7 +1789,7 @@ static eFrameProcessingResult_t prvProcessIPPacket( const IPPacket_t * pxIPPacke NetworkBufferDescriptor_t * const pxNetworkBuffer ) { eFrameProcessingResult_t eReturn; - UBaseType_t uxHeaderLength; + UBaseType_t uxHeaderLength = ipSIZE_OF_IPv4_HEADER; uint8_t ucProtocol = 0U; #if ( ipconfigUSE_IPv6 != 0 ) From 0d29874d4d2e4faaa1cfcc83a7f3b5e054cc3068 Mon Sep 17 00:00:00 2001 From: Monika Date: Thu, 27 Jul 2023 14:22:22 +0530 Subject: [PATCH 4/8] Fix [-Wformat-pedantic --- source/FreeRTOS_ARP.c | 2 +- source/FreeRTOS_DHCPv6.c | 4 +-- source/FreeRTOS_DNS.c | 2 +- source/FreeRTOS_ND.c | 38 ++++++++++++------------- source/FreeRTOS_RA.c | 12 ++++---- source/FreeRTOS_Routing.c | 18 ++++++------ source/FreeRTOS_Sockets.c | 11 +++---- source/FreeRTOS_TCP_Transmission.c | 4 +-- source/FreeRTOS_TCP_Transmission_IPV6.c | 4 +-- source/FreeRTOS_UDP_IPv6.c | 2 +- 10 files changed, 49 insertions(+), 48 deletions(-) diff --git a/source/FreeRTOS_ARP.c b/source/FreeRTOS_ARP.c index dc52b9fe8..252e38ab0 100644 --- a/source/FreeRTOS_ARP.c +++ b/source/FreeRTOS_ARP.c @@ -554,7 +554,7 @@ BaseType_t xCheckRequiresARPResolution( const NetworkBufferDescriptor_t * pxNetw ( ucNextHeader == ipPROTOCOL_UDP ) ) { IPv6_Type_t eType = xIPv6_GetIPType( ( const IPv6_Address_t * ) pxIPAddress ); - FreeRTOS_printf( ( "xCheckRequiresARPResolution: %pip type %s\n", pxIPAddress->ucBytes, ( eType == eIPv6_Global ) ? "Global" : ( eType == eIPv6_LinkLocal ) ? "LinkLocal" : "other" ) ); + FreeRTOS_printf( ( "xCheckRequiresARPResolution: %pip type %s\n", ( void * ) pxIPAddress->ucBytes, ( eType == eIPv6_Global ) ? "Global" : ( eType == eIPv6_LinkLocal ) ? "LinkLocal" : "other" ) ); if( eType == eIPv6_LinkLocal ) { diff --git a/source/FreeRTOS_DHCPv6.c b/source/FreeRTOS_DHCPv6.c index 3c54d51fd..717c79f80 100644 --- a/source/FreeRTOS_DHCPv6.c +++ b/source/FreeRTOS_DHCPv6.c @@ -1159,7 +1159,7 @@ static BaseType_t prvDHCPv6_subOption( uint16_t usOption, ( void ) xBitConfig_read_uc( pxMessage, pxDHCPMessage->xIPAddress.xIP_IPv6.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); pxDHCPMessage->ulPreferredLifeTime = ulBitConfig_read_32( pxMessage ); pxDHCPMessage->ulValidLifeTime = ulBitConfig_read_32( pxMessage ); - FreeRTOS_printf( ( "IP Address %pip\n", pxDHCPMessage->xIPAddress.xIP_IPv6.ucBytes ) ); + FreeRTOS_printf( ( "IP Address %pip\n", ( void * ) pxDHCPMessage->xIPAddress.xIP_IPv6.ucBytes ) ); break; case DHCPv6_Option_IA_Prefix: @@ -1167,7 +1167,7 @@ static BaseType_t prvDHCPv6_subOption( uint16_t usOption, pxDHCPMessage->ulValidLifeTime = ulBitConfig_read_32( pxMessage ); pxDHCPMessage->ucprefixLength = ucBitConfig_read_8( pxMessage ); ( void ) xBitConfig_read_uc( pxMessage, pxDHCPMessage->xPrefixAddress.xIP_IPv6.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); - FreeRTOS_printf( ( "Address prefix: %pip length %d\n", pxDHCPMessage->xPrefixAddress.xIP_IPv6.ucBytes, pxDHCPMessage->ucprefixLength ) ); + FreeRTOS_printf( ( "Address prefix: %pip length %d\n", ( void * ) pxDHCPMessage->xPrefixAddress.xIP_IPv6.ucBytes, pxDHCPMessage->ucprefixLength ) ); break; case DHCPv6_Option_Status_Code: diff --git a/source/FreeRTOS_DNS.c b/source/FreeRTOS_DNS.c index c8b21af79..e487398a6 100644 --- a/source/FreeRTOS_DNS.c +++ b/source/FreeRTOS_DNS.c @@ -657,7 +657,7 @@ if( ( ppxAddressInfo != NULL ) && ( ( *ppxAddressInfo )->ai_family == FREERTOS_AF_INET6 ) ) { FreeRTOS_printf( ( "prvPrepareLookup: found '%s' in cache: %pip\n", - pcHostName, ( *ppxAddressInfo )->xPrivateStorage.sockaddr.sin_address.xIP_IPv6.ucBytes ) ); + pcHostName, ( void * ) ( *ppxAddressInfo )->xPrivateStorage.sockaddr.sin_address.xIP_IPv6.ucBytes ) ); } else #endif diff --git a/source/FreeRTOS_ND.c b/source/FreeRTOS_ND.c index 439c5038a..35bb4db17 100644 --- a/source/FreeRTOS_ND.c +++ b/source/FreeRTOS_ND.c @@ -202,7 +202,7 @@ if( eReturn == eARPCacheMiss ) { - FreeRTOS_printf( ( "eNDGetCacheEntry: lookup %pip miss\n", pxIPAddress->ucBytes ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: lookup %pip miss\n", ( void * ) pxIPAddress->ucBytes ) ); } if( eReturn == eARPCacheMiss ) @@ -219,8 +219,8 @@ } FreeRTOS_printf( ( "eNDGetCacheEntry: FindEndPointOnIP failed for %pip (endpoint %pip)\n", - pxIPAddress->ucBytes, - pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); + ( void * ) pxIPAddress->ucBytes, + ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); } else { @@ -239,7 +239,7 @@ } } - FreeRTOS_printf( ( "eNDGetCacheEntry: LinkLocal %pip \"%s\"\n", pxIPAddress->ucBytes, + FreeRTOS_printf( ( "eNDGetCacheEntry: LinkLocal %pip \"%s\"\n", ( void * ) pxIPAddress->ucBytes, ( eReturn == eARPCacheHit ) ? "hit" : "miss" ) ); } else @@ -249,15 +249,15 @@ if( pxEndPoint != NULL ) { ( void ) memcpy( pxIPAddress->ucBytes, pxEndPoint->ipv6_settings.xGatewayAddress.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); - FreeRTOS_printf( ( "eNDGetCacheEntry: Using gw %pip\n", pxIPAddress->ucBytes ) ); - FreeRTOS_printf( ( "eNDGetCacheEntry: From addr %pip\n", pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: Using gw %pip\n", ( void * ) pxIPAddress->ucBytes ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: From addr %pip\n", ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); /* See if the gateway has an entry in the cache. */ eReturn = prvNDCacheLookup( pxIPAddress, pxMACAddress, ppxEndPoint ); if( *ppxEndPoint != NULL ) { - FreeRTOS_printf( ( "eNDGetCacheEntry: found end-point %pip\n", ( *ppxEndPoint )->ipv6_settings.xIPAddress.ucBytes ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: found end-point %pip\n", ( void * ) ( *ppxEndPoint )->ipv6_settings.xIPAddress.ucBytes ) ); } *( ppxEndPoint ) = pxEndPoint; @@ -325,7 +325,7 @@ } else { - FreeRTOS_printf( ( "vNDRefreshCacheEntry: %pip not found\n", pxIPAddress->ucBytes ) ); + FreeRTOS_printf( ( "vNDRefreshCacheEntry: %pip not found\n", ( void * ) pxIPAddress->ucBytes ) ); } } /*-----------------------------------------------------------*/ @@ -442,7 +442,7 @@ FreeRTOS_debug_printf( ( "prvCacheLookup6[ %d ] %pip with %02x:%02x:%02x:%02x:%02x:%02x\n", ( int ) x, - pxAddressToLookup->ucBytes, + ( void * ) pxAddressToLookup->ucBytes, pxMACAddress->ucBytes[ 0 ], pxMACAddress->ucBytes[ 1 ], pxMACAddress->ucBytes[ 2 ], @@ -459,7 +459,7 @@ if( eReturn == eARPCacheMiss ) { - FreeRTOS_printf( ( "prvNDCacheLookup %pip Miss\n", pxAddressToLookup->ucBytes ) ); + FreeRTOS_printf( ( "prvNDCacheLookup %pip Miss\n", ( void * ) pxAddressToLookup->ucBytes ) ); if( ppxEndPoint != NULL ) { @@ -491,7 +491,7 @@ FreeRTOS_printf( ( "ND %2d: age %3u - %pip MAC %02x-%02x-%02x-%02x-%02x-%02x endPoint %s\n", ( int ) x, xNDCache[ x ].ucAge, - xNDCache[ x ].xIPAddress.ucBytes, + ( void * ) xNDCache[ x ].xIPAddress.ucBytes, xNDCache[ x ].xMACAddress.ucBytes[ 0 ], xNDCache[ x ].xMACAddress.ucBytes[ 1 ], xNDCache[ x ].xMACAddress.ucBytes[ 2 ], @@ -729,7 +729,7 @@ { /* No endpoint found for the target IP-address. */ FreeRTOS_printf( ( "SendPingRequestIPv6: no end-point found for %pip\n", - pxIPAddress->ucBytes ) ); + ( void * ) pxIPAddress->ucBytes ) ); } else if( ( uxGetNumberOfFreeNetworkBuffers() >= 3U ) && ( uxNumberOfBytesToSend >= 1U ) && ( xEnoughSpace != pdFALSE ) ) { @@ -761,7 +761,7 @@ pxICMPPacket->xIPHeader.usPayloadLength = FreeRTOS_htons( sizeof( ICMPEcho_IPv6_t ) + uxNumberOfBytesToSend ); ( void ) memcpy( pxICMPPacket->xIPHeader.xDestinationAddress.ucBytes, pxIPAddress->ucBytes, ipSIZE_OF_IPv6_ADDRESS ); ( void ) memcpy( pxICMPPacket->xIPHeader.xSourceAddress.ucBytes, pxEndPoint->ipv6_settings.xIPAddress.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); - FreeRTOS_printf( ( "ICMP send from %pip\n", pxICMPPacket->xIPHeader.xSourceAddress.ucBytes ) ); + FreeRTOS_printf( ( "ICMP send from %pip\n", ( void * ) pxICMPPacket->xIPHeader.xSourceAddress.ucBytes ) ); /* Fill in the basic header information. */ pxICMPHeader->ucTypeOfMessage = ipICMP_PING_REQUEST_IPv6; @@ -949,8 +949,8 @@ FreeRTOS_printf( ( "ICMPv6_recv %d (%s) from %pip to %pip end-point = %s\n", pxICMPHeader_IPv6->ucTypeOfMessage, pcMessageType( ( BaseType_t ) pxICMPHeader_IPv6->ucTypeOfMessage ), - pxICMPPacket->xIPHeader.xSourceAddress.ucBytes, - pxICMPPacket->xIPHeader.xDestinationAddress.ucBytes, + ( void * ) pxICMPPacket->xIPHeader.xSourceAddress.ucBytes, + ( void * ) pxICMPPacket->xIPHeader.xDestinationAddress.ucBytes, pcEndpointName( pxEndPoint, pcAddress, sizeof( pcAddress ) ) ) ); } } @@ -1032,7 +1032,7 @@ char pcName[ 40 ]; ( void ) memset( &( pcName ), 0, sizeof( pcName ) ); FreeRTOS_printf( ( "Lookup %pip : endpoint %s\n", - pxICMPHeader_IPv6->xIPv6Address.ucBytes, + ( void * ) pxICMPHeader_IPv6->xIPv6Address.ucBytes, pcEndpointName( pxEndPointFound, pcName, sizeof( pcName ) ) ) ); if( pxEndPointFound != NULL ) @@ -1055,8 +1055,8 @@ xCompare = memcmp( pxICMPHeader_IPv6->xIPv6Address.ucBytes, pxEndPoint->ipv6_settings.xIPAddress.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); FreeRTOS_printf( ( "ND NS for %pip endpoint %pip %s\n", - pxICMPHeader_IPv6->xIPv6Address.ucBytes, - pxEndPoint->ipv6_settings.xIPAddress.ucBytes, + ( void * ) pxICMPHeader_IPv6->xIPv6Address.ucBytes, + ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes, ( xCompare == 0 ) ? "Reply" : "Ignore" ) ); if( xCompare == 0 ) @@ -1086,7 +1086,7 @@ &( pxICMPHeader_IPv6->xIPv6Address ), pxEndPoint ); FreeRTOS_printf( ( "NEIGHBOR_ADV from %pip\n", - pxICMPHeader_IPv6->xIPv6Address.ucBytes ) ); + ( void * ) pxICMPHeader_IPv6->xIPv6Address.ucBytes ) ); #if ( ipconfigUSE_RA != 0 ) diff --git a/source/FreeRTOS_RA.c b/source/FreeRTOS_RA.c index e36d8aea0..c549b87d8 100644 --- a/source/FreeRTOS_RA.c +++ b/source/FreeRTOS_RA.c @@ -152,7 +152,7 @@ } else { - FreeRTOS_printf( ( "RA: source %pip\n", xSourceAddress.ucBytes ) ); + FreeRTOS_printf( ( "RA: source %pip\n", ( void * ) xSourceAddress.ucBytes ) ); } if( pxDescriptor->xDataLength < uxNeededSize ) @@ -318,7 +318,7 @@ pxPrefixOption->ucPrefixLength, FreeRTOS_ntohl( pxPrefixOption->ulValidLifeTime ), FreeRTOS_ntohl( pxPrefixOption->ulPreferredLifeTime ), - pxPrefixOption->ucPrefix ) ); + ( void * ) pxPrefixOption->ucPrefix ) ); break; case ndICMP_REDIRECTED_HEADER: /* 4 */ @@ -489,7 +489,7 @@ pxEndPoint->xRAData.eRAState = eRAStatePreLease; iptraceRA_SUCCEDEED( &( pxEndPoint->ipv6_settings.xIPAddress ) ); FreeRTOS_printf( ( "RA: succeeded, using IP address %pip Reload after %u seconds\n", - pxEndPoint->ipv6_settings.xIPAddress.ucBytes, + ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes, ( unsigned ) pxEndPoint->xRAData.ulPreferredLifeTime ) ); } else @@ -499,7 +499,7 @@ iptraceRA_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( &( pxEndPoint->ipv6_settings.xIPAddress ) ); - FreeRTOS_printf( ( "RA: failed, using default parameters and IP address %pip\n", pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); + FreeRTOS_printf( ( "RA: failed, using default parameters and IP address %pip\n", ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); /* Disable the timer. */ uxNewReloadTime = 0U; } @@ -577,7 +577,7 @@ FreeRTOS_printf( ( "RA: Creating a random IP-address\n" ) ); } - FreeRTOS_printf( ( "RA: Neighbour solicitation for %pip\n", pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); + FreeRTOS_printf( ( "RA: Neighbour solicitation for %pip\n", ( void * ) pxEndPoint->ipv6_settings.xIPAddress.ucBytes ) ); uxNeededSize = ipSIZE_OF_ETH_HEADER + ipSIZE_OF_IPv6_HEADER + sizeof( ICMPHeader_IPv6_t ); pxNetworkBuffer = pxGetNetworkBufferWithDescriptor( uxNeededSize, raDONT_BLOCK ); @@ -661,7 +661,7 @@ { FreeRTOS_printf( ( "vRAProcess( %ld, %pip) bRouterReplied=%d bIPAddressInUse=%d state %d -> %d\n", xDoReset, - pxEndPoint->ipv6_defaults.xIPAddress.ucBytes, + ( void * ) pxEndPoint->ipv6_defaults.xIPAddress.ucBytes, pxEndPoint->xRAData.bits.bRouterReplied, pxEndPoint->xRAData.bits.bIPAddressInUse, eRAState, diff --git a/source/FreeRTOS_Routing.c b/source/FreeRTOS_Routing.c index 4c9c3813f..e165d5a31 100644 --- a/source/FreeRTOS_Routing.c +++ b/source/FreeRTOS_Routing.c @@ -101,8 +101,8 @@ struct xIPv6_Couple { /* Invalid input. */ FreeRTOS_printf( ( "FreeRTOS_FillEndPoint: Invalid input, netif=%p, endpoint=%p\n", - pxNetworkInterface, - pxEndPoint ) ); + ( void * ) pxNetworkInterface, + ( void * ) pxEndPoint ) ); } else { @@ -299,7 +299,7 @@ struct xIPv6_Couple FreeRTOS_printf( ( "FreeRTOS_AddEndPoint: MAC: %02x-%02x IPv6: %pip\n", pxEndPoint->xMACAddress.ucBytes[ 4 ], pxEndPoint->xMACAddress.ucBytes[ 5 ], - pxEndPoint->ipv6_defaults.xIPAddress.ucBytes ) ); + ( void * ) pxEndPoint->ipv6_defaults.xIPAddress.ucBytes ) ); } #endif /* ( ipconfigUSE_IPv6 != 0 ) */ #if ( ipconfigUSE_IPv4 != 0 ) @@ -634,10 +634,10 @@ struct xIPv6_Couple { /* Invalid input. */ FreeRTOS_printf( ( "FreeRTOS_FillEndPoint_IPv6: Invalid input, netif=%p, endpoint=%p, pxIPAddress=%p, ucMACAddress=%p\n", - pxNetworkInterface, - pxEndPoint, - pxIPAddress, - ucMACAddress ) ); + ( void * ) pxNetworkInterface, + ( void * ) pxEndPoint, + ( void * ) pxIPAddress, + ( void * ) ucMACAddress ) ); } else { @@ -767,8 +767,8 @@ struct xIPv6_Couple if( xGatewayTarget == pdTRUE ) { FreeRTOS_debug_printf( ( " GW address %pip to %pip\n", - pxIPAddressFrom->xIP_IPv6.ucBytes, - pxIPAddressTo->xIP_IPv6.ucBytes ) ); + ( void * ) pxIPAddressFrom->xIP_IPv6.ucBytes, + ( void * ) pxIPAddressTo->xIP_IPv6.ucBytes ) ); } xTargetGlobal = ( xIPv6_GetIPType( &( pxIPAddressTo->xIP_IPv6 ) ) == eIPv6_Global ) ? pdTRUE : pdFALSE; diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index 8d1d32f22..733a77004 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -2199,9 +2199,9 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket ) #if ( ipconfigUSE_IPv6 != 0 ) case pdTRUE_UNSIGNED: ( void ) snprintf( pucSocketProps, sizeof( pucSocketProps ), "%pip port %u to %pip port %u", - pxSocket->xLocalAddress.xIP_IPv6.ucBytes, + ( void * ) pxSocket->xLocalAddress.xIP_IPv6.ucBytes, pxSocket->usLocalPort, - pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes, + ( void * ) pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes, pxSocket->u.xTCP.usRemotePort ); break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ @@ -2231,7 +2231,7 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket ) case pdTRUE_UNSIGNED: ( void ) snprintf( pucSocketProps, sizeof( pucSocketProps ), "%pip port %u", - pxSocket->xLocalAddress.xIP_IPv6.ucBytes, + ( void * ) pxSocket->xLocalAddress.xIP_IPv6.ucBytes, pxSocket->usLocalPort ); break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ @@ -3702,7 +3702,8 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket ) case FREERTOS_AF_INET6: pxSocket->bits.bIsIPv6 = pdTRUE_UNSIGNED; FreeRTOS_printf( ( "FreeRTOS_connect: %u to %pip port %u\n", - pxSocket->usLocalPort, pxAddress->sin_address.xIP_IPv6.ucBytes, FreeRTOS_ntohs( pxAddress->sin_port ) ) ); + pxSocket->usLocalPort, ( void * ) pxAddress->sin_address.xIP_IPv6.ucBytes, + FreeRTOS_ntohs( pxAddress->sin_port ) ) ); ( void ) memcpy( pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes, pxAddress->sin_address.xIP_IPv6.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ @@ -5807,7 +5808,7 @@ void * pvSocketGetSocketID( const ConstSocket_t xSocket ) case pdTRUE_UNSIGNED: ( void ) snprintf( pcRemoteIp, sizeof( pcRemoteIp ), - "%pip", pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes ); + "%pip", ( void * ) pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes ); break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ diff --git a/source/FreeRTOS_TCP_Transmission.c b/source/FreeRTOS_TCP_Transmission.c index 30caa9382..63d76fecd 100644 --- a/source/FreeRTOS_TCP_Transmission.c +++ b/source/FreeRTOS_TCP_Transmission.c @@ -772,8 +772,8 @@ if( pxNetworkBuffer->pxEndPoint == NULL ) { FreeRTOS_printf( ( "prvTCPReturnPacket: no such end-point %pip => %pip\n", - pxIPHeader_IPv6->xSourceAddress.ucBytes, - pxIPHeader_IPv6->xDestinationAddress.ucBytes ) ); + ( void * ) pxIPHeader_IPv6->xSourceAddress.ucBytes, + ( void * ) pxIPHeader_IPv6->xDestinationAddress.ucBytes ) ); } break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ diff --git a/source/FreeRTOS_TCP_Transmission_IPV6.c b/source/FreeRTOS_TCP_Transmission_IPV6.c index 6c7d08923..0a3c610bf 100644 --- a/source/FreeRTOS_TCP_Transmission_IPV6.c +++ b/source/FreeRTOS_TCP_Transmission_IPV6.c @@ -336,7 +336,7 @@ BaseType_t prvTCPPrepareConnect_IPV6( FreeRTOS_Socket_t * pxSocket ) ( void ) memset( xRemoteIP.xIP_IPv6.ucBytes, 0, ipSIZE_OF_IPv6_ADDRESS ); ( void ) memcpy( xRemoteIP.xIP_IPv6.ucBytes, pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); eReturned = eNDGetCacheEntry( &( xRemoteIP.xIP_IPv6 ), &( xEthAddress ), &( pxEndPoint ) ); - FreeRTOS_printf( ( "eNDGetCacheEntry: %d with end-point %p\n", eReturned, pxEndPoint ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: %d with end-point %p\n", eReturned, ( void * ) pxEndPoint ) ); if( pxEndPoint != NULL ) { @@ -360,7 +360,7 @@ BaseType_t prvTCPPrepareConnect_IPV6( FreeRTOS_Socket_t * pxSocket ) /* Count the number of times it could not find the ARP address. */ pxSocket->u.xTCP.ucRepCount++; - FreeRTOS_printf( ( "Looking up %pip with%s end-point\n", xRemoteIP.xIP_IPv6.ucBytes, ( pxEndPoint != NULL ) ? "" : "out" ) ); + FreeRTOS_printf( ( "Looking up %pip with%s end-point\n", ( void * ) xRemoteIP.xIP_IPv6.ucBytes, ( pxEndPoint != NULL ) ? "" : "out" ) ); if( pxEndPoint != NULL ) { diff --git a/source/FreeRTOS_UDP_IPv6.c b/source/FreeRTOS_UDP_IPv6.c index 712de1266..15f793434 100644 --- a/source/FreeRTOS_UDP_IPv6.c +++ b/source/FreeRTOS_UDP_IPv6.c @@ -140,7 +140,7 @@ static eARPLookupResult_t prvStartLookup( NetworkBufferDescriptor_t * const pxNe if( pxUDPPacket->xEthernetHeader.usFrameType == ipIPv6_FRAME_TYPE ) { FreeRTOS_printf( ( "Looking up %pip with%s end-point\n", - pxNetworkBuffer->xIPAddress.xIP_IPv6.ucBytes, + ( void * ) pxNetworkBuffer->xIPAddress.xIP_IPv6.ucBytes, ( pxNetworkBuffer->pxEndPoint != NULL ) ? "" : "out" ) ); if( pxNetworkBuffer->pxEndPoint == NULL ) From 90b321727481a59d288c18a6391f09c2cae40a0b Mon Sep 17 00:00:00 2001 From: Monika Date: Thu, 27 Jul 2023 16:16:09 +0530 Subject: [PATCH 5/8] Fix Wcompound-token-split-by-space and Wgnu-statement-expression --- source/include/FreeRTOS_IP_Private.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/include/FreeRTOS_IP_Private.h b/source/include/FreeRTOS_IP_Private.h index 329812e76..d1decea89 100644 --- a/source/include/FreeRTOS_IP_Private.h +++ b/source/include/FreeRTOS_IP_Private.h @@ -411,11 +411,7 @@ extern struct xNetworkInterface * pxNetworkInterfaces; /** @brief Macro calculates the number of elements in an array as a size_t. */ #ifndef ARRAY_SIZE_X #ifndef _WINDOWS_ - #define ARRAY_SIZE_X( x ) \ - ( { size_t uxCount = ( sizeof( x ) / sizeof( x[ 0 ] ) ); \ - BaseType_t xCount = ( BaseType_t ) uxCount; \ - xCount; } \ - ) + #define ARRAY_SIZE_X( x ) ( BaseType_t ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) #else #define ARRAY_SIZE_X( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) #endif From 8ee1e780bb1a83d07391e032aaae374b6a3e04b4 Mon Sep 17 00:00:00 2001 From: Monika Date: Thu, 27 Jul 2023 16:16:32 +0530 Subject: [PATCH 6/8] Add suppression --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b393c26ad..0f5453650 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,6 +196,7 @@ add_compile_options( $<$:-Wall> $<$:-Wextra> $<$:-Werror> + $<$:-Wpedantic> $<$:-Wconversion> $<$:-Wunused-variable> $<$:-Weverything> @@ -208,6 +209,8 @@ add_compile_options( $<$:-Wno-padded> $<$:-Wno-missing-variable-declarations> $<$:-Wno-covered-switch-default> + $<$:-Wno-extra-semi-stmt> + $<$:-Wno-missing-noreturn> $<$:-Wno-cast-align> ) From f60e5f6fab53bbeb34724c0c79368eb7596da59d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 27 Jul 2023 11:26:36 +0000 Subject: [PATCH 7/8] Uncrustify: triggered by comment. --- source/FreeRTOS_ND.c | 2 +- source/FreeRTOS_Sockets.c | 2 +- source/include/FreeRTOS_IP_Private.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/FreeRTOS_ND.c b/source/FreeRTOS_ND.c index 35bb4db17..1eafaad38 100644 --- a/source/FreeRTOS_ND.c +++ b/source/FreeRTOS_ND.c @@ -257,7 +257,7 @@ if( *ppxEndPoint != NULL ) { - FreeRTOS_printf( ( "eNDGetCacheEntry: found end-point %pip\n", ( void * ) ( *ppxEndPoint )->ipv6_settings.xIPAddress.ucBytes ) ); + FreeRTOS_printf( ( "eNDGetCacheEntry: found end-point %pip\n", ( void * ) ( *ppxEndPoint )->ipv6_settings.xIPAddress.ucBytes ) ); } *( ppxEndPoint ) = pxEndPoint; diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index 733a77004..6f495e65d 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -3703,7 +3703,7 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket ) pxSocket->bits.bIsIPv6 = pdTRUE_UNSIGNED; FreeRTOS_printf( ( "FreeRTOS_connect: %u to %pip port %u\n", pxSocket->usLocalPort, ( void * ) pxAddress->sin_address.xIP_IPv6.ucBytes, - FreeRTOS_ntohs( pxAddress->sin_port ) ) ); + FreeRTOS_ntohs( pxAddress->sin_port ) ) ); ( void ) memcpy( pxSocket->u.xTCP.xRemoteIP.xIP_IPv6.ucBytes, pxAddress->sin_address.xIP_IPv6.ucBytes, ipSIZE_OF_IPv6_ADDRESS ); break; #endif /* ( ipconfigUSE_IPv6 != 0 ) */ diff --git a/source/include/FreeRTOS_IP_Private.h b/source/include/FreeRTOS_IP_Private.h index d1decea89..d12c6e9f1 100644 --- a/source/include/FreeRTOS_IP_Private.h +++ b/source/include/FreeRTOS_IP_Private.h @@ -411,7 +411,7 @@ extern struct xNetworkInterface * pxNetworkInterfaces; /** @brief Macro calculates the number of elements in an array as a size_t. */ #ifndef ARRAY_SIZE_X #ifndef _WINDOWS_ - #define ARRAY_SIZE_X( x ) ( BaseType_t ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) + #define ARRAY_SIZE_X( x ) ( BaseType_t ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) #else #define ARRAY_SIZE_X( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) #endif From 4e578b004915f5b39f41da8fef78c23814dc9f2e Mon Sep 17 00:00:00 2001 From: Monika Singh Date: Fri, 28 Jul 2023 04:30:33 +0000 Subject: [PATCH 8/8] Fix coverity --- source/include/FreeRTOS_IP_Private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/include/FreeRTOS_IP_Private.h b/source/include/FreeRTOS_IP_Private.h index d12c6e9f1..cd48139e6 100644 --- a/source/include/FreeRTOS_IP_Private.h +++ b/source/include/FreeRTOS_IP_Private.h @@ -411,7 +411,7 @@ extern struct xNetworkInterface * pxNetworkInterfaces; /** @brief Macro calculates the number of elements in an array as a size_t. */ #ifndef ARRAY_SIZE_X #ifndef _WINDOWS_ - #define ARRAY_SIZE_X( x ) ( BaseType_t ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) + #define ARRAY_SIZE_X( x ) ( ( BaseType_t ) sizeof( x ) / ( BaseType_t ) sizeof( x[ 0 ] ) ) #else #define ARRAY_SIZE_X( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) ) #endif