From: Wolfgang Denk Date: Wed, 28 Jan 2009 23:27:47 +0100 Subject: [U-Boot] IP_t should be a "packed" struct In-Reply-To: References: <200901271932.11060.luigi.mantellini.ml@gmail.com> <49809C21.6070004@gmail.com> <4980A5AA.2090306@ge.com> <4980AAC3.7020601@gmail.com> <4980CC59.1070302@gmail.com> <20090128213828.13423832E416@gemini.denx.de> Message-ID: <20090128222747.CEBFD832E416@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Luigi Mantellini, In message you wrote: > > I think that an audit of the code is important to understand if we > have a problem (or not) and how large is the problem. We (i. e. all of us except you) do not have a problem. > My compiler is not broken... Well, YMMV... > cassini linux # find -name \*.c -o -name \*.h |xargs grep attribute | > grep packed | wc -l > 3153 > > I see a lot of packed structs... > > Here is for example a copy of /usr/include/netinet/ip.h : ... > This doesn't say anything regarding how kernel guys have resolved the > problem (if they are solved...). Checking the kernel headers a lot This is not a kernel header. This is one of the standard user space network headers, and a pretty central one. Feel free to check any others. > I think that "struct packing" needs to be understood and a global I agree on this. This definitely needs to be understood. Hm... I think I understand it, and it works for me :-) > mechanism should be used (like -fpack-struct option always defined or > a style guideline that requires a tag for each structs). From my point I think this is not needed. Please read the docuemntation about alignment and padding. It is pretty clear. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "And it should be the law: If you use the word `paradigm' without knowing what the dictionary says it means, you go to jail. No exceptions." - David Jones @ Megatest Corporation