patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8357, Silence some GCC warnings (contrib)

 
 

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

patch #8357: Silence some GCC warnings (contrib)

Submitter:  Fatih Aşıcı <fatih>
Submitted:  Wed 26 Feb 2014 09:19:16 AM UTC
   
 
Category:  Contrib Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Wed 17 Sep 2014 08:18:03 PM UTC, comment #2: 

Foxed tcpdump.c -> tcpip.c warnings can be solved by not checking for != NULL, since it is always called with '&' now.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 26 Feb 2014 09:03:15 PM UTC, comment #1: 

Regarding tcpip.c:
This warning is only generated because of the way mboxes are define in the port. I only can repeat what I said in patch #8356: I don't know how to solve this while still keeping a single function-like-define that can be used on both pointers and variables.

Regarding udpecho.c:
Fixed, thanks for reporting. That was some strange coding style...

Regarding tcpdump.c:
I don't have linux running right now to be able to fix this one, but I think we'd rather have to clean up the define "IPv4" in the makefiles first...

Simon Goldschmidt <goldsimon>
Group administrator
Wed 26 Feb 2014 09:19:16 AM UTC, original submission:  

unixsim Makefile uses -Werror. It can be built now without errors.

Fixes the following GCC warnings:

/../../../lwip/src -c ../../../../../lwip/src/api/tcpip.c
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_input’:
../../../../../lwip/src/api/tcpip.c:191:8: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_callback_with_block’:
../../../../../lwip/src/api/tcpip.c:226:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_timeout’:
../../../../../lwip/src/api/tcpip.c:262:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_untimeout’:
../../../../../lwip/src/api/tcpip.c:291:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_apimsg’:
../../../../../lwip/src/api/tcpip.c:325:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
../../../../../lwip/src/api/tcpip.c: In function ‘tcpip_trycallback’:
../../../../../lwip/src/api/tcpip.c:433:8: warning: the comparison will always evaluate as ‘true’ for the address of ‘mbox’ will never be NULL [-Waddress]
/../../../lwip/src -c ../../../../apps/udpecho/udpecho.c
../../../../apps/udpecho/udpecho.c: In function ‘udpecho_thread’:
../../../../apps/udpecho/udpecho.c:49:25: warning: variable ‘port’ set but not used [-Wunused-but-set-variable]
../../../../apps/udpecho/udpecho.c:48:21: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
appears when IPv6 enabled:
/../../../lwip/src -c ../../../../ports/unix/netif/tcpdump.c
../../../../ports/unix/netif/tcpdump.c: In function ‘tcpdump’:
../../../../ports/unix/netif/tcpdump.c:71:7: warning: unused variable ‘offset’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:70:7: warning: unused variable ‘len’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:69:7: warning: unused variable ‘i’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:68:8: warning: unused variable ‘flags’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:66:19: warning: unused variable ‘udphdr’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:64:19: warning: unused variable ‘tcphdr’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:63:18: warning: unused variable ‘iphdr’ [-Wunused-variable]
../../../../ports/unix/netif/tcpdump.c:61:22: warning: unused parameter ‘p’ [-Wunused-parameter]

Fatih Aşıcı <fatih>

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by fatih (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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-17 goldsimon StatusIn Progress Done
        Open/ClosedOpen Closed
    2014-02-26 goldsimon StatusNone In Progress
        Assigned toNone goldsimon
    2014-02-26 fatih Attached File- Added 0001-Silence-GCC-warnings.patch, #30706

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code