Re: GCC 2.96 shows bogus memory allocation when allocating some given structs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux