This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Byte array address alignement
- From: "Michael Anburaj" <embeddedeng at hotmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 26 Oct 2005 04:01:21 +0000
- Subject: [ECOS] Byte array address alignement
- Bcc:
Hi,
I have very general compiler question. Since, there are a lot of experts
here, I am sure I will get an answer :)
I see that most compiler follow this alignment rule for byte arrays (I guess
structures too), that they get aligned at least on a 4byte boundary on a
32bit machine (like ARM or MIPS32 & so on).
I don?t know if this alignment is an artifact of something else or the
tool-chain has a rule as such for doing so.
Can anyone who is familiar with this, throw some light on this subject?
1. I am curious to know if such a rule exists in C compilers?
2. If so, what is it called? It will be great if you could point me to some
matrial.
Thanks a lot,
-Mike.
Sample code:
Char C1;
Char C2[8];
Char C3;
&C1 is equal to 0x800001
&C2 is equal to 0x800004
&C3 is equal to 0x800002
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss