Dear lpc2000, I am trying to port some Keil example code (LPC2148 USBHID) to the GCC compiler. Keil use the __packed keyword to specify byte alignment for variables (see http://www.keilsoftware.com/support/man/docs/ca/ca_le_packed.htm) but this is not supported by GCC. I know GCC provides an "__attribute__ ((__packed__))" which can be used in variable declarations, but how can I type cast to a byte aligned variable type!? My problem line is below... *((__packed WORD *)EP0Buf) = (USB_EndPointHalt & m) ? 1 : 0; Thanks! Nic
Message
Type cast to byte aligned variable in GCC
2006-02-19 by weartronics