AnsweredAssumed Answered

structure paddinf : codewarrior compiler

Question asked by ruby krishna on Dec 15, 2014
Latest reply on Dec 16, 2014 by rickli

Hi,

I have a doubt in strucure padding relavant to code warrior IDE.  I'm working on a 16 bit microcontroller mc9s12xhy.

 

typedef struct{

unsigned int x;

unsigned char y;

 

}Error_mode;

 

Error_mode Error_mode_Data;

 

While compiler compiles the code, it shall allocate 4 bytes for Error_mode_Data ( with padding  refernce: .map file ). It doesnt seem to happen. It s allocating 3 bytes only. Hw to switch on/off padding in a code warrior compiler? this is critical coz of im using for EEPROM write/read!

Outcomes