Question about uint8 array align on 5744

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about uint8 array align on 5744

1,317 Views
liujinhang
Contributor III

hi,
i defined an array with type of uint8, and i found it is always alignning on 4 bytes. According to my idea, the array type is uint8, why not aligned by 1 byte?
PS:i used Greenhill compiler and the MCU is 5744P.
i did not found any description about array alignning mechanism in EABI and Greenhills UM.
thanks very much.

0 Kudos
5 Replies

1,094 Views
liujinhang
Contributor III

any body help me?

0 Kudos

1,094 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

could you please share the source code, eventually whole project?

Regards,

Martin

0 Kudos

1,094 Views
liujinhang
Contributor III

he Martin,

can you help me for up problem?

0 Kudos

1,094 Views
liujinhang
Contributor III

Hi Martin,

can you help me to confirm that  the array address is always 4 bytes aligning?

0 Kudos

1,094 Views
liujinhang
Contributor III

Hi Martin,

thanks for your response.

my code like bellow:

uint8_t A[5] = {0};

uint8_t B[5] = {0};

the point can be sure that there are no any optimize operation at my project.

when i check the address of A[0] and B[0], I found that the the address of A[0] is less 8 bytes than B[0] ,but not only 5 bytes as my opinion.

so i guess that the array address is always 4 bytes aligning.

but i can not found any evidence to prove my guesswork in all my document like EABI or Greenhills UM I have got.

0 Kudos