[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Strange "always true" conditional in tcp_in.c
From: |
Lou Cypher |
Subject: |
Re: [lwip-users] Strange "always true" conditional in tcp_in.c |
Date: |
Tue, 02 Mar 2010 17:29:04 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 |
> The original check intends to be still valid if the type of 'dupacks' is
> changed in the future, therefore, I think it is better than explicitly
> checking for a constant (0xFF). This kind of check is used in multiple places
> throughout the stack and should have a comment stating that this is an
> overflow check.
Then it should become something like
if( pcb->dupacks != (DUPACK_TYPE)-1 )
or any similar expression -- as the proposal from Bill Auerbach of checking the
incremented variable against zero: the above has just no run-time overhead.
> I didn't check yet if the bug report here is valid, but at least under
> VS2005/2008 and cygwin-gcc, there is no such warning...
Well, VS isn't always that good at spotting warnings(...) and GCC has a "-Wall"
that doesn't even mean "all warnings", just to amuse programmers :)
Note: I didn't check it with any compiler yet
~Lou
- Re: [lwip-users] Strange "always true" conditional in tcp_in.c, (continued)
- Re: [lwip-users] Strange "always true" conditional in tcp_in.c, Simon Goldschmidt, 2010/03/01
- Re: [lwip-users] Strange "always true" conditional in tcp_in.c, Kieran Mansley, 2010/03/01
- Re: [lwip-users] Strange "always true" conditional in tcp_in.c, Mike Kleshov, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Auerbach, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Auerbach, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Auerbach, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Auerbach, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Kieran Mansley, 2010/03/01
- RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Auerbach, 2010/03/01
RE: [lwip-users] Strange "always true" conditional in tcp_in.c, Bill Yang, 2010/03/01
Re: [lwip-users] Strange "always true" conditional in tcp_in.c,
Lou Cypher <=