[rtems-lwip commit] xadapter: fix compiler warnings
Joel Sherrill
joel at rtems.org
Sat Jan 6 02:12:07 UTC 2024
Module: rtems-lwip
Branch: master
Commit: 065ed8f2ed21b9fc06b787e9987c2927aeeb1285
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=065ed8f2ed21b9fc06b787e9987c2927aeeb1285
Author: Bernd Moessner <berndmoessner80 at gmail.com>
Date: Fri Jan 5 19:39:55 2024 +0100
xadapter: fix compiler warnings
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.
---
.../lwip211/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;
}
}
More information about the vc
mailing list