[EMAIL PROTECTED] wrote on 8/28/2008 3:43 PM: > Alain, Michael, > > I agree this is the worst problem when porting lwIP to another > compiler (not platform), but until someone comes up with an idea that > is really easy and nice to implement, I'm still against including such > workarounds for bad (sorry, only my opinion!) compilers! > > What would be the solution for the sizeof() problem? Define every > sizeof independently of the struct definition? > > Simon > > > _______________________________________________ > lwip-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/lwip-users > Hi Simon,
Seems like sizeof() as a MEMCPY arguement out of a fragment should only be used "stdint.h" or similarly typed fields (so that you don't get burned as you suggest), or it shouldn't be used. Protocol fragment sizes should be #defined, in a purist sense, because the protocol defines the fragment size, not the compiler. Like I tried to say before... I agree with everything you say except "another compiler (not platform)". A lot of times there is only one compiler for a platform. I'm sure as hell not going to port GCC to a multi-ALU DSP and hope to get the same performance as the TI compiler does. We're stuck it with. It may be a "bad" compiler, but using structure overlaying with #pragma pack, while convenient and elegant, is simply not universally portable. The person who ported the autoip.c code was nice enough to use MEMCPY() instead of assignment to data structures, and this ported cleanly to our "crappy" compiler (though we got lucky in that the sizeof() operands matched, so even that wasn't perfect). Worked right out of the box. DNS didn't. So, seems like it's not impossible to be more friendly to a user base that's probably larger than you think.... The "sorry, you're out of luck response" is OK, I can deal with that, and I appreciate the contributors to lwIP very much. But it has sort of stifled any motivation on my end to get too active in pushing capabilities and bug fixes we've ported back into the code base. -Mike
begin:vcard fn:Michael Williamson n:Williamson;Michael org:Critical Link LLC;Engineering adr:;;6712 Brooklawn Parkway;Syracuse;NY;13211;USA email;internet:[EMAIL PROTECTED] title:Senior Engineer tel;work:315-425-4045 x230 tel;fax:315-425-4048 tel;cell:315-663-4604 x-mozilla-html:TRUE url:http://www.criticallink.com version:2.1 end:vcard
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
