|
From: | Ambroz Bizjak |
Subject: | [lwip-devel] [bug #51447] Sequence number comparisons invoke undefined behavior |
Date: | Tue, 11 Jul 2017 18:26:13 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 |
Follow-up Comment #1, bug #51447 (project lwip): forgot to cast the diferences to u32... the right code is: #define TCP_SEQ_LT(a,b) ((u32_t)((u32_t)(a) - (u32_t)(b)) >= 0x80000000u) #define TCP_SEQ_LT(a,b) (((u32_t)((u32_t)(a) - (u32_t)(b)) & 0x80000000u) != 0) #define TCP_SEQ_LT(a,b) ((u32_t)((u32_t)(a) - (u32_t)(b)) >> 31) _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?51447> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |