This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__attribute__ ((packed)) doesn't work


Hello,

I use an ARM9 development board, GCC 3.3.3 and the eCos Version 2.0. I'm
developing an USB driver. 
I got some trouble with the descriptor structures declared in "USB.h".
After the compilation these 
structs show the size of an alignment of 4 bytes boundary and not the
real size.

typedef struct usb_configuration_descriptor {
...
} usb_configuration_descriptor __attribute__((packed));

I moved the position of "__attribute__((packed))" to -> 

typedef struct usb_configuration_descriptor {
...
} __attribute__((packed)) usb_configuration_descriptor; 

and it works. So what did I wrong respectively what do I have to do it
works without changes?

The 2nd question why the does the "usb_endpoint_descriptor" own this
attribute though it has 
a size of 7 bytes and doesn't fit at 4 bytes boundary? Without this
attribute described above
the same misalignment is occured. 

Any ideas or hints? 

Thanks in advance Thomas  

This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law.  If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system.  If you
have any questions about this e-mail please notify the sender
immediately.

Ce message (ainsi que les eventuelles pieces jointes) est
exclusivement adresse au destinataire et contient des
informations confidentielles. La copie, la communication ou la
distribution du contenu de ce message sans l'accord prealable de
l'expediteur sont strictement interdits et peuvent constituer un
delit. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur. Si vous avez des questions se
rapportant a ce courrier electronique, merci de bien vouloir
notifier
l'expediteur immediatement.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]