public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16321] New: 64 bit structure passing problem (g++, not gcc)
@ 2004-07-01 21:19 jeff at rtr dot com
  2004-07-01 21:22 ` [Bug c++/16321] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jeff at rtr dot com @ 2004-07-01 21:19 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-11-16 22:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-01 21:19 [Bug c++/16321] New: 64 bit structure passing problem (g++, not gcc) jeff at rtr dot com
2004-07-01 21:22 ` [Bug c++/16321] " pinskia at gcc dot gnu dot org
2004-07-02 12:56 ` jeff at silk dot rtr dot com
2004-07-20  8:10 ` pinskia at gcc dot gnu dot org
2004-08-16  0:26 ` giovannibajo at libero dot it
2004-11-15  3:40 ` pinskia at gcc dot gnu dot org
2004-11-16 22:01 ` jeff at rtr dot com
2004-11-16 22:48 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).