This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 2.96 shows bogus memory allocation when allocating some givenstructs?
- From: John Love-Jensen <eljay at adobe dot com>
- To: Claudio Lavecchia <Claudio dot Lavecchia at eurecom dot fr>, gcc-help at gcc dot gnu dot org
- Date: Thu, 29 Jul 2004 10:42:19 -0500
- Subject: Re: GCC 2.96 shows bogus memory allocation when allocating some givenstructs?
Hi Claudio,
For alignment purposes, the compiler may stick in some padding bytes.
If the designers of C wanted to be cruel, they could have forced you to put
in the necessary padding or generate a compile time error.
struct s2
{
char a[6];
char pad[2];
int b;
};
But they figured that was an implementation detail that the compiler could
do for you.
HTH,
--Eljay