Hi All
I am trying to get some code that compiles and runs happily on x86 to compile
and run on my ipaq(familiar unstable with latest kernel). The problem is it
compiles and runs, but doesn't give the same answer:( Both compilers are
2.95.3 and the host environment is SuSE 7.3
Here's the ensense of the issue. There a number of packed structures
declared which pack as expected under x86, but don't under armv4l using a
cross compile toolchain.
example
#pragma pack (1)
typedef struct {
short data[4];
unsigned char char1;
unsigned char char2;
} dataRecord;
#pragma pack ()
usage for example
dataRecord * rec;
int recsize = sizeof(*rec);
Under the x86 compiler recsize reports as 10 and under the arm xcompiler as
12, which as you can imagine causes some downstream whoopsies!
Now, I know that gcc info recommends against the "#pragma pack (1)"
construct, however "__attribute__ packed" in the appropriate places doesn't
change the result.
Anyone else seen this problem, or any thoughts (constructive ones only
please:))?
Regards
Bob
Received on Fri Jul 26 15:02:16 2002
This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:44:55 EDT