Bit operations work differently on MIPS and IA32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

 

I ran the below program on an IA32 and AU1100 machine, both being little endian machines and got different results. Does anyone know what could be the cause of this behaviour. This problem is blocking us from booting the cramfs rootfs.

 

#include <stdio.h>

typedef unsigned int u32;

main()

{

struct tmp{

u32 namelen:6,offset:26;

}tmp1;

 

(*(int *)(&tmp1))=0x4c0;

 

printf("%d %d\n",tmp1.namelen,tmp1.offset);

 

}

 

Results on IA32 : 0 19

 

Results on AU1100 (MIPS):  0 1216

 

Thanks

hemanth


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux