[LLVMbugs] [Bug 4400] New: Structure Alignment in MSVC

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jun 16 06:24:31 PDT 2009


           Summary: Structure Alignment in MSVC
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Keywords: portability
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: manoel at fonetica.com.br
                CC: llvmbugs at cs.uiuc.edu

In Windows plataform with  MSVC:

target datalayout =
        %FIRSTSTRU = type { i32,  double, i32, i8* }

If I define a strucutre like %FIRSTSTRU and a function like :


   ret i32 1

 in the C side I do

struct  xfirstStru 
        int     var1;
        double  var2;
        int     var3;
        char    *var4;
typedef  struct xfirstStru      osX ;
typedef  osX* PosX ;

PosX    xf      = (PosX)        malloc( sizeof(osX) );
char *paux      = (char*)       malloc( 256 );
strcpy(paux,"teste C - LLVM");
and we call the LLVM function from the C function,

the fields , from the double one, are not at the expected position.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list