AnsweredAssumed Answered

Aligned attribute not working in CW11.0

Question asked by Gordon Pocock on Feb 16, 2018
Latest reply on Feb 22, 2018 by ZhangJennie

I have found that the "aligned" attribute doesn't appear to work properly. I am using CW 11.0 for the S12ZVC processor.

 

volatile uint32_t ADC0CommandList[11] __attribute__ ((aligned(4))); //max 256 bytes = 64 commands per 4-byte entries
volatile uint16_t ADC0ResultList[11]  __attribute__ ((aligned(4))); //max 128 bytes = 64 results per 2-byte entries

 

This results in ADC0Command List not being located on a 4 byte boundary (as shown in the map file).

 

ADC0CommandList                           1252      2C      44      12   .common  

 

In the end, I had to add some padding in order to force this variable to the correct place. Any ideas?

Outcomes