lwIP - A Lightweight TCP/IP stack - Patches: patch #5822, Handle unused arguments
You are not allowed to post comments on this tracker with your current authentication level.
patch #5822: Handle unused arguments
Submitter: | Simon Goldschmidt <goldsimon> | ||
Submitted: | Mon 26 Mar 2007 04:03:29 PM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | Done | Privacy: | Public |
Assigned to: | goldsimon | Open/Closed: | Closed |
Planned Release: | None |
Jump to the original submission
Tue 24 Apr 2007 08:42:57 AM UTC, comment #14: |
Simon Goldschmidt <goldsimon> |
Tue 24 Apr 2007 08:24:25 AM UTC, comment #13: Just ran into another three unused parameter in LWIP_RAW=1, LWIP_REASSEMBLY=1 and LWIP_ARP=1 cases. See attached patch for quick a fix. |
Tai-hwa Liang <atliang> |
Mon 16 Apr 2007 07:47:39 PM UTC, comment #12: re comment #11:
|
Simon Goldschmidt <goldsimon> |
Wed 11 Apr 2007 10:21:22 PM UTC, comment #11: "-Wuninitialized -Winit-self" should do all the 'arg = arg' cases.
|
Jonathan Larmour <jifl> |
Wed 11 Apr 2007 07:41:14 PM UTC, comment #10: I've converted all statements like '(void)arg;' into 'LWIP_UNUSED_ARG(arg);'
|
Simon Goldschmidt <goldsimon> |
Wed 04 Apr 2007 07:35:05 PM UTC, comment #9: I'm including
|
Simon Goldschmidt <goldsimon> |
Wed 28 Mar 2007 07:55:51 AM UTC, comment #8: Forgot to mention that my patch was tested with all "Inefficient Coding" warnings turned on in Paradigm Pro, particularly, "Parameter 'ident is never used" and "'ident declared but never used."
|
Tai-hwa Liang <atliang> |
Wed 28 Mar 2007 07:22:42 AM UTC, comment #7: About remove any unsed arguments, it will not be possible always. By example, in api_msg.c, in recv_udp, the prototype is defined by udp_recv, so, you can't change it without breaking the api.
|
Frédéric Bernon <fbernon> |
Wed 28 Mar 2007 07:00:10 AM UTC, comment #6: That patch seems rather complete, but I want to look over all the code again: as Kieran said: The best solution would be to remove any unused arguments from the function declaration!
|
Simon Goldschmidt <goldsimon> |
Wed 28 Mar 2007 02:12:41 AM UTC, comment #5: Not sure about where is the right place to put LWIP_UNUSED_ARG as cc.h is port specific. For now I leave it in lwip/arch.h.
|
Tai-hwa Liang <atliang> |
Tue 27 Mar 2007 07:45:38 AM UTC, comment #4: The best solution would be to remove any unused arguments from the function declaration!
|
Kieran Mansley <kieranm> |
Mon 26 Mar 2007 04:22:02 PM UTC, comment #3: Ok I understand. In my case, my compiler generate warning to any unsed arguments. Your solution can help to avoid warning to everyone. I suppose cc.h is the good location to define it, right?
|
Frédéric Bernon <fbernon> |
Mon 26 Mar 2007 04:17:36 PM UTC, comment #2: It's not that I fear these statements would bloat lwIP binary size, only that different compilers have very different views of what to warn about. Statements like "arg = arg;" or "arg;" often give a warning like "statement has no effect". Personally, I prefer simply not to warn about unused arguments.
|
Simon Goldschmidt <goldsimon> |
Mon 26 Mar 2007 04:07:29 PM UTC, comment #1: Ok for me, but can you explain what is the problem? Do you think a binary code is generated by such instructions ? Or is it just for source code style? How do you want to define LWIP_UNUSED_ARG ?
|
Frédéric Bernon <fbernon> |
Mon 26 Mar 2007 04:03:29 PM UTC, original submission:
In some functions unused arguments are used (e.g. "arg;" or "arg = arg;") to prevent compiler warnings. This should either be modified to something like "LWIP_UNUSED_ARG(arg);" or completely left away. |
Simon Goldschmidt <goldsimon> |
Depends on the following items: None found
Items that depend on this one: None found
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 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-04-24 | atliang | Attached File | - | Added unused.patch, #12584 | |
2007-04-16 | goldsimon | Status | In Progress | Done | |
Open/Closed | Open | Closed | |||
2007-04-04 | goldsimon | Assigned to | None | goldsimon | |
2007-04-04 | goldsimon | Status | None | In Progress | |
2007-03-28 | atliang | Attached File | - | Added unused.patch, #12314 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Thanks, checked it in.