[PATCH rtems-lwip - v2 2/2] xadapter: fix compiler warnings

Kinsey Moore kinsey.moore at oarcorp.com
Fri Jan 5 19:31:01 UTC 2024


This looks good to me.

Kinsey

On Fri, Jan 5, 2024 at 12:50 PM <berndmoessner80 at gmail.com> wrote:

> From: Bernd Moessner <berndmoessner80 at gmail.com>
>
> This fix addresses two issues:
>
> 1) Wrong format specifier is used to print a 64bit address pointer
> 2) The compiler issues a couple of warnings as the Xilinx code omits to
> cast pointers ip_addr_t to
> the required ip4_addr_t or ip6_addr_t tpye.
>
> Note, ip_addr_t can hold ip4_addr_t and ip6_addr_t. Therefore, the
> complaints by GCC are correct, but
> do not indicate a major bug.
> ---
>  .../src/contrib/ports/xilinx/netif/xadapter.c       | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git
> a/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xadapter.c
> b/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xadapter.c
> index 9594ff5..93ff148 100644
> ---
> a/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xadapter.c
> +++
> b/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xadapter.c
> @@ -171,7 +171,14 @@ xemac_add(struct netif *netif,
>  #if defined (__arm__) || defined (__aarch64__)
>                         case xemac_type_emacps:
>  #ifdef XLWIP_CONFIG_INCLUDE_GEM
> +#ifndef __rtems__
>                                 return netif_add(netif, ipaddr, netmask,
> gw,
> +#else /* __rtems__ */
> +                               return netif_add( netif,
> +                                               (const ip4_addr_t *)
> ipaddr,
> +                                               (const ip4_addr_t *)
> netmask,
> +                                               (const ip4_addr_t *) gw,
> +#endif
>                                                 (void*)mac_baseaddr,
>                                                 xemacpsif_init,
>  #if NO_SYS
> @@ -184,8 +191,14 @@ xemac_add(struct netif *netif,
>  #endif
>  #endif
>                         default:
> +#ifndef __rtems__
>                                 xil_printf("unable to determine type of
> EMAC with baseaddress 0x%08x\r\n",
>                                                 mac_baseaddr);
> +#else /* __rtems__ */
> +                               xil_printf("unable to determine type of
> EMAC with baseaddress %" PRIXPTR,
> +                                               mac_baseaddr);
> +                               xil_printf("\r\n");
> +#endif
>                                 return NULL;
>         }
>  }
> --
> 2.34.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240105/a7f86567/attachment.htm>


More information about the devel mailing list