Re: allocation alignment for global and local variables.
- From: "Nils O. Selåsdal" <NOS@xxxxxxx>
- Date: Fri, 30 Sep 2005 13:48:53 +0200
gamja wrote:
Hi all.
I know that some padding bits are inserted between data members of a structure. Is this rule also applied for the variables on local stack or global??? For example, in following code dumps...
There isn't a rule. It's up to the implementation.
------------ struct foo foo1; ... struct bar bar1; ... char byte; int dword;
int main(void) { } -------------- Is it allowed to expect that each start address of foo1, bar1, byte and dword are aligned 4bytes?
No.
(well, noone prohibits you from expecting whatever you want ;-)
Does the C99 specification state any rules related with this problem?
No. This is no problem. .
- References:
- Prev by Date: Re: Universal (g)libc
- Next by Date: Re: offsetof
- Previous by thread: allocation alignment for global and local variables.
- Next by thread: Re: allocation alignment for global and local variables.
- Index(es):