lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Struct packing/alignment problems


From: d99tibr
Subject: Re: [lwip-users] Struct packing/alignment problems
Date: Mon, 26 Apr 2004 15:53:46 +0200
User-agent: Internet Messaging Program (IMP) 3.2.1

Quoting "K.J. Mansley" <address@hidden>:

> On Mon, 2004-04-26 at 11:47, Jani Monoses wrote:
> > > That's alot of work you have done there.
> > > A decent solution to this alignment problem is really needed, because as
> 
> > > it is now, lwip is incompatible with most 32bit embedded CPUs.(!!) (Such
> 
> > > as ARM, TI DSPs, ...)
> > 
> > more correctly incompatible with some compilers. lwip works fine on ARM
> using gcc.
> 
> Quite.  I wonder if the effort to get lwip to work with the compilers
> that currently have problems could be better spent getting the compilers
> to work with packed structs!  I doubt this is feasible though, so we are
> going to have to address this recurrent problem sooner or later.
> 
> Kieran

gcc must do some very weird stuff to get unaligned packed structures to work on 
ARM.
lwip currently depends highly on compiler specific extensions to compile. 
Structure packing for unaligned memory access is not ANSI C. Don't blaim the 
compilers when it is the code that is wrong!
gcc is not the C language definition, ANSI C is. I believe good code should be 
written to comply with ANSI C, not gcc. Don't you think? :)

Timmy

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




reply via email to

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