This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Packed structures
- From: Phil Prentice <philp dot cheer at btinternet dot com>
- To: gcc-help at gnu dot org,gcc at gnu dot org
- Date: Wed, 2 Jul 2003 12:04:04 +0100
- Subject: Packed structures
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