Structure Padding

Hi,

I am facing some problem because structure padding.

I need help in solving the padding problem on structure.

Thanks!

  • This is NOT a HEW discussion but a discussion about the compiler you use.

    Some processors (like SH) require that word data is even aligned and long data is aligned to 4 byte addresses. Depending on your structure it may be neccessary to insert padding bytes to aligne data properly.

    It may also be that a compiler inserts padding bytes to speed up memory access. But this depends on the compiler.