Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Struct/Union alignement problem with Crossworks

2005-09-20 by nourson54

I tried to set the attibute on all structs/unions but at compiling
time , gcc told : "`__packed__' attribute ignored" for each attribute ...





--- In lpc2000@yahoogroups.com, "Paul Curtis" <plc@r...> wrote:
> If you have a union of two (or more) structures, those structures must
> also have a packed attribute.
> 
> --
> Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
> CrossWorks for MSP430, ARM, AVR and now MAXQ processors
> 
> > -----Original Message-----
> > From: nourson54 [mailto:nourson54@y...] 
> > Sent: 20 September 2005 14:54
> > To: lpc2000@yahoogroups.com
> > Subject: [lpc2000] Struct/Union alignement problem with Crossworks
> > 
> > Hello,
> > 
> > I'm trying a fat16 library that use an union for storing the 
> > bootsector data, and it seems the compiler doesn't handle 
> > correctly the width of types in memory. 
> > So I searched some help on crossworks (gcc) compiler and 
> > found that I have to use this attribute with my concerned unions :
> >  __attribute__ ((__packed__))
> > 
> > But if the compiler doesn't shout at me when compiling , it 
> > seems it has no effect : my union is badly aligned.
> > 
> > Have any idea ?
> > 
> > 
> > 
> > 
> > 
> > ------------------------ Yahoo! Groups Sponsor 
> > --------------------~--> Fair play? Video games influencing 
> > politics. Click and talk back!
> > http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/dN_tlB/TM
> > --------------------------------------------------------------
> > ------~-> 
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> >

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.