lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Strange "always true" conditional in tcp_in.c


From: Simon Goldschmidt
Subject: Re: [lwip-users] Strange "always true" conditional in tcp_in.c
Date: Mon, 01 Mar 2010 10:05:46 +0100

Lou Cypher wrote:
> The case above isn't always true, in fact it yields false when
> pcb->dupacks == 0xFF.
> May be that was the intended behavior? Then could have been shorter (and
> more
> intuitive) checking for
>   if( pcb->dupacks != 0xFF )

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.

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...

Simon
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser




reply via email to

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