?Hello,

I use LWIP in professional capacity.

Here I face a common warning due ot a varialble defined in file viz. pbuf.c

When LWIP Asserts  are off compilation warning is seen.


Please find attached a patch which helps get rid of this warning.

Please let me know if this can be pulled in man stream.




Thanks & Best Regards,
Nirav
LWIP: Get rid of build warnings when LWIP asserts are off

When user set LWIP_NOASSERT to 1 build warnings are seen
for unused variable "err"
---
 src/core/pbuf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index 14dfb72..4b2ae44 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -1167,7 +1167,9 @@ struct pbuf*
 pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
 {
   struct pbuf *q;
+#ifndef LWIP_NOASSERT
   err_t err;
+#endif
   if (p->next == NULL) {
     return p;
   }
@@ -1176,8 +1178,12 @@ pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
     /* @todo: what do we do now? */
     return p;
   }
+#ifndef LWIP_NOASSERT
   err = pbuf_copy(q, p);
   LWIP_ASSERT("pbuf_copy failed", err == ERR_OK);
+#else
+  pbuf_copy(q, p);
+#endif
   pbuf_free(p);
   return q;
 }
-- 
2.7.4

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to