This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16321] New: 64 bit structure passing problem (g++, not gcc)
- From: "jeff at rtr dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2004 21:19:31 -0000
- Subject: [Bug c++/16321] New: 64 bit structure passing problem (g++, not gcc)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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);
}
--
Summary: 64 bit structure passing problem (g++, not gcc)
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeff at rtr dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-ibm-aix5.1.0.0
GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16321