Structures on the Raspberry Pi (Debian linux)
Ray Newman
ray@woopwoop.com
Mon Jul 2 06:45:00 GMT 2012
Hi,
I have an implementation of the MUMPS language that has been in use for approx 12 years on the x86 under FreeBSD, linux and OSX.
In the code there is the following structure definition which describes an on disk structure and hence can't really be changed.
typedef struct DB_BLOCK // database block layout
{ u_char type; // block type
u_char flags; // flags
u_short spare; // future
u_int right_ptr; // right pointer
u_short last_idx; // last used index off
u_short last_free; // last free lw in block
chr_q global; // global name
} DB_Block; // end block header
This structure works OK on the x86 but on the Raspberry Pi, the global element is extracted from the data commencing at global+4 for 8 bytes.
Is there some way to force gcc to have global at +12 and not +16 in the structure?
I tried compiling with the switch -fpack-struct; but this broke the whole thing.
Thank you,
Ray Newman
More information about the Gcc-help
mailing list