This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Structure Padding

Hi there, This is with respect to Keil USB mass storage example program (LPC2368 based MCB 2300 evaluation board is being used). The program works fine when compiled with Real View Compiler and tested. But, with the GNU compiler it doesnot work. No errors are being reported.

I have done the following changes and would like to know if this is correct and if any additional things need to be taken care of.

In Keil's Real view compiler based example code for which the packed attribute used is

*((__packed  DWORD *) pData) = RX_DATA;

and in GNU compiler, code i have modified for packed attribute as follows

*((__attribute__ ((packed))  DWORD *) pData) = RX_DATA;

0