Summary: ppp.h version 1.2 has broken Macros GETSORT/LONG
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: None
Submitted on: Tuesday 02/13/2007 at 16:39 UTC
Severity: 3 - Normal
Item Group: Faulty Behaviour
Assigned to: None
Discussion Lock: Any
[bug #19052] ppp.h version 1.2 has broken Macros GETSORT/LONG
Follow-up Comment #1, bug #19052 (project lwip):
I expect the second line of the macro should contain (s)<<=8;
I think this is attempting to work around a problem which recurs (for me)
many times throughout lwip.
There are many macros which attempt to construct 16- or 32-bit quantities by
taking a number of bytes and shifting them left various amounts.
Unfortunately, in my compiler at least, taking a byte/char and shifting it
left by more than 7 bits is optimised completely away UNLESS the value is
first cast to a u16_t or a u32_t.