lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #66039] 'pcb->local_ip' equal to a null pointer is alw


From: Balazs G
Subject: [lwip-devel] [bug #66039] 'pcb->local_ip' equal to a null pointer is always false
Date: Mon, 29 Jul 2024 03:01:38 -0400 (EDT)

URL:
  <https://savannah.nongnu.org/bugs/?66039>

                 Summary: 'pcb->local_ip' equal to a null pointer is always
false
                   Group: lwIP - A Lightweight TCP/IP stack
               Submitter: gorogbalazs
               Submitted: Mon 29 Jul 2024 07:01:36 AM UTC
                Category: UDP
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.1.2


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 29 Jul 2024 07:01:36 AM UTC By: Balazs G <gorogbalazs>
I get the following compiler warnings (clang, hightec tricore v9.0.0). They
seem to be justified (udp_pcb.local_ip is a value type). Tcp is also affected.
Issue does not seem to be fixed in 2.2.

../lwip/src/core/tcp_out.c:1296:15: warning: comparison of address of
'pcb->local_ip' equal to a null pointer is always false
[-Wtautological-pointer-compare]
 1296 |   if (((&pcb->local_ip) == ((void*)0) || ((*(&pcb->local_ip)).addr ==
((u32_t)0x00000000UL)))) {
      |          ~~~~~^~~~~~~~     ~~~~~~~~~~

../lwip/src/core/udp.c:164:22: warning: comparison of address of
'pcb->local_ip' equal to a null pointer is always false
[-Wtautological-pointer-compare]
  164 |         if ((((&pcb->local_ip)) == ((void*)0) ||
((*((&pcb->local_ip))).addr == ((u32_t)0x00000000UL))) ||
      |                 ~~~~~^~~~~~~~      ~~~~~~~~~~
../lwip/src/core/udp.c:173:19: warning: comparison of address of
'pcb->local_ip' equal to a null pointer is always false
[-Wtautological-pointer-compare]
  173 |       if (((&pcb->local_ip) == ((void*)0) || ((*(&pcb->local_ip)).addr
== ((u32_t)0x00000000UL))) || ((&pcb->local_ip)->addr ==
((&ip_data.current_iphdr_dest))->addr)) {
      |              ~~~~~^~~~~~~~     ~~~~~~~~~~
../lwip/src/core/udp.c:673:18: warning: comparison of address of
'pcb->local_ip' equal to a null pointer is always false
[-Wtautological-pointer-compare]
  673 |     if ((((&pcb->local_ip)) == ((void*)0) ||
((*((&pcb->local_ip))).addr == ((u32_t)0x00000000UL))) ||
      |             ~~~~~^~~~~~~~      ~~~~~~~~~~
../lwip/src/core/udp.c:1002:24: warning: comparison of address of
'ipcb->local_ip' equal to a null pointer is always false
[-Wtautological-pointer-compare]
 1002 |               ((&ipcb->local_ip) == ((void*)0) ||
((*(&ipcb->local_ip)).addr == ((u32_t)0x00000000UL))))) {
      |                  ~~~~~~^~~~~~~~     ~~~~~~~~~~









    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?66039>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]