title: sizeof returns different values for a struct when compiling different programs
body: <p>I have 2 programs that share a header file. This header file defines a structure with a few members. There is then a #define: <code>#define STRUCTURE_SIZE sizeof(OUR_STRUCTURE)</code>. </p>
  
  <p>This structure is then used in shared memory with <code>STRUCTURE_SIZE</code> being used for the <code>size</code> argument to <code>shmget()</code>. </p>
  
  <p>Unfortunately, for the one program, STRUCTURE_SIZE ends up being 20758, while in the other one, it ends up being 20764. So when the second program tries to get the shared mem, <code>shmget()</code> returns EINVAL. </p>
  
  <p><code>uname -a</code>:</p>
  
  <p><code>Linux machine 2.6.30.10-105.2.23.fc11.i686.PAE #1 SMP Thu Feb 11 07:05:37 UTC 2010 i686 i686 i386 GNU/Linux</code> </p>
  
  <p><code>g++ --version</code>:</p>
  
  <p><code>g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2)</code></p>