FreeRTOS+TCP - DHCP type qualifier warnings


I am facing some warnings that look a bit fishy and would like feedback on whether or not I should be looking to patch this code. I am not sure of the type qualifier impact without looking at the code (maybe performance?). I am hoping I can continue without any serious problems.

/FreeRTOS-Plus-TCP/FreeRTOS_DHCP.c: In function 'prvProcessDHCPReplies':
/FreeRTOS-Plus-TCP/FreeRTOS_DHCP.c:756:46: warning: passing argument 1 of 'prvIsValidDHCPResponse' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  756 |             else if( prvIsValidDHCPResponse( pxDHCPMessage ) == pdFAIL )
      |                                              ^~~~~~~~~~~~~
/FreeRTOS-Plus-TCP/FreeRTOS_DHCP.c:698:68: note: expected 'DHCPMessage_IPv4_t *' {aka 'struct xDHCPMessage_IPv4 *'} but argument is of type 'const DHCPMessage_IPv4_t *' {aka 'const struct xDHCPMessage_IPv4 *'}
  698 |     static BaseType_t prvIsValidDHCPResponse( DHCPMessage_IPv4_t * pxDHCPMessage )
      |                                               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/FreeRTOS-Plus-TCP/FreeRTOS_DHCP.c: In function 'prvSendDHCPDiscover':
/FreeRTOS-Plus-TCP/FreeRTOS_DHCP.c:1191:24: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1191 |             pvCopyDest = &pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + dhcpREQUESTED_IP_ADDRESS_OFFSET ];
      |                        ^

I don’t think these warnings are going to cause you run-time issues, but they need cleaning up all the same.

Fantastic - thank you for the confidence boost :slight_smile:

Thanks @rpcme and @rtel.
I have created a PR to address this issue: Fix warnings in FreeRTOS_DHCP.c by AniruddhaKanhere · Pull Request #371 · FreeRTOS/FreeRTOS-Plus-TCP · GitHub