First of all, thanks for looking into this.

The difference in our environments is:

gcc 4.3.2 32 bit x86 vs gcc 4.4.3 64 bit x86

So it could be either the 32 vs 64 bits or 4.3.2 vs 4.4.3

The following structure has a different layout between 32 64 bit
systems.  I suspect that is when the problem shows up.

typedef struct {
 off_t fs;
 unsigned int i1;
 unsigned int i2;
} TESTRIO;

I ran another test that included all the code in one module.

**** test file

#include <stdio.h> /* printf */

#define _FILE_OFFSET_BITS 64
#include <sys/types.h> /* off_t */

typedef struct {
        off_t fs;
        unsigned int i1;
        unsigned int i2;
} TESTRIO;

int
rio_init(TESTRIO *rio){
    rio->fs = (off_t)(-1);
    rio->i1 = 1;
    rio->i2 = 2;
    return 0;
}
int
main(
        int argc,
        char *argv[]
){
        TESTRIO rio;
    rio_init(&rio);
    printf("i1=%u, i2=%u\n", rio.i1, rio.i2);
        return 0;
}

**** end test code

This in fact passed.  So the problem is s subtle one and might be
related to linkage or whatever.

Robert Ramey


** Attachment added: "same example - all in one module - passes"
   
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/629092/+attachment/1557508/+files/main.c

-- 
gcc 4.3.2 compiler included with kubuntu fails on simple structure
https://bugs.launchpad.net/bugs/629092
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to