> >> As far as I know the approach above is perfectly legal
It's compiler-specific, and moreover, since judging from what you
write it's likely that that region resides on the card itself
(otherwise why use an absolute address?), it's also
hardware-specific.
And it is also OS specific. :-)
Not sure I'm followinig you here.
I disovered what my problem was. Initially I had a _true_ POD header:
struct header {
unsigned int data_size;
unsigned int message_id;
// more stuff
};
Then I changed it to:
struct header {
unsigned int data_size;
unsigned int message_id;
header()
: data_size(0)
, message_id(0)
{}
};
For the latter, header is no longer a POD. As a result all bets are
off, hence I suspect thats the reason the 'destination' was seeing a
bogus value for message_id. It's as if it wasn't initialized.
So I'll just resort back to the C style struct (the former) and memset
the damn thing. This alleviates the need to have to serialize the data
and all the other mess that accompanies the non pod struct.