Mail Archives: djgpp/2000/05/09/07:29:10
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>:
> > In DJGPP, since it's a 32-bit compiler, when I make
> a variable of type
> char,
> > does it store that variable in a 32-bit slot in
> memory, or an 8-bit slot?
>
> A `char' takes a single byte.
I am not an expert about gcc internals, so I sould say
something silly here: do you mean that this function
allocates only two bytes of stack for auto variables?
void func(void)
{
char a, b;
...
}
I thought gcc aligned to 32 bit words auto variables
for efficiency reasons, like with struct members, thus
allocating 8 bytes in the above example.
More or less equivalent to this:
struct char_ab {
char a, b;
};
void func(void)
{
struct char_ab ab;
...
}
ciao
Giacomo
------------------------------------------------------
Giacomo Degli Esposti - pad2369 AT iperbole DOT bologna DOT it
- Raw text -