This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Structure alignment under AIX 4.3.1
- To: egcs-bugs at cygnus dot com
- Subject: Structure alignment under AIX 4.3.1
- From: Jacques_Goussard at cimmetry dot com
- Date: Mon, 17 May 1999 16:19:01 -0400
Hi
Found that various structure declaration that are equivalent on other
platforms than AIX4.3.1 (tested Solaris and HPUX) could be not equivalent under
AIX.
Could this alignment pb be a bug :
gcc -v : gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
uname -a : AIX neptune 3 4 004558184C00
TEST : compiled with no specific options
#include <stdio.h>
#include <stdlib.h>
typedef struct _D3d {
double x,y,z;
} D3d;
typedef struct _D3d_tab{
double x[3];
} D3d_tab;
typedef struct _L1D3_tab {
long int l;
double d[3];
} L1D3_tab;
typedef struct _L1D3_struc1{
long int l;
D3d d;
} L1D3_struc1;
typedef struct _L1D3_struc2{
long int l;
D3d_tab d;
} L1D3_struc2;
int main()
{
printf("%i\n",sizeof(L1D3_tab));
printf("%i\n",sizeof(L1D3_struc1));
printf("%i\n",sizeof(L1D3_struc2));
return 0;
}
produces
28
32
28
as output ?
Could it be 4-bytes aligned in first struct, 8-bytes in second and again 4 in
third ???
Jacques-Olivier Goussard