buglwIP - A Lightweight TCP/IP stack - Bugs: bug #66039, 'pcb->local_ip' equal to a null...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66039: 'pcb->local_ip' equal to a null pointer is always false

Submitter:  Balazs G <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 Planned Release:  None
lwIP version:  2.1.2

Mon 29 Jul 2024 07:38:24 AM UTC, comment #1: 

note: found similar warnings since the reporting in
tcp_in.c
tcp.c

Balazs G <gorogbalazs>
Mon 29 Jul 2024 07:01:36 AM UTC, original submission:  

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))))) {
      |                  ~~~~~~^~~~~~~~     ~~~~~~~~~~


Balazs G <gorogbalazs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gorogbalazs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code