Packed structures
Phil Prentice
philp.cheer@btinternet.com
Wed Jul 2 11:03:00 GMT 2003
Hi
I'm using a gnu X-compiler (2.95.3) (Linux to VxWorks Intel). I have a
device driver that maps memory to a device. It uses packed structures to aid
this, in that the packed structures maps exactly to what the hardware
expects. The only way I can attempt to mimic this using the X-compiler is to
use the -fpack-struct compiler option. But this I assume would affect all
structures in the file being compiled. It's turns out to be a lot of work to
try and split the structures out of the files in question.
Is there any way of making the compiler only pack the structures that require
packing?
I think that my only option at the moment is to access the hardware registers
directly (by offsets). The other way is clever but not very portable???
Thanks
Phil
More information about the Gcc
mailing list