The following code fails using -maix64 (g++, NOT gcc). Using -DFIX64 (to make the structure size a multiple of 8 bytes fixes the problem). #include <stdio.h> #include <string.h> typedef struct _x { char str1[80]; char str2[40]; int i; #ifdef FIX64 int dummy; #endif } x; int sub( x d ) { printf( "%s\n", d.str1 ); printf( "%s\n", d.str2 ); } main() { x data; strncpy( data.str1, "this is the first test string", 80 ); strncpy( data.str2, "this is the second test string", 40 ); sub(data); }
Can you try a newer compiler than 3.2? 3.4 would be the best compiler to try.
Subject: Re: 64 bit structure passing problem (g++, not gcc) Sure, but it will have to wait until I get back from vacation (the week of the 12th). Jeff According to pinskia at gcc dot gnu dot org: > > >------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-01 21:22 ------- >Can you try a newer compiler than 3.2? >3.4 would be the best compiler to try. > >-- > > >http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16321 > >------- You are receiving this mail because: ------- >You reported the bug, or are watching the reporter. >
Waiting for a double-check with GCC 3.4.
Any news?
Subject: Re: 64 bit structure passing problem (g++, not gcc) Hi, I tested it with gcc 3.4.3 today and the bug seems to have been fixed. Regards, Jeff According to pinskia at gcc dot gnu dot org: > > >------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-15 03:39 ------- >Any news? > >-- > > >http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16321 > >------- You are receiving this mail because: ------- >You reported the bug, or are watching the reporter. >
Closing as fixed.