options instead of "#pragma pack()"

How can we change the code alignment using compiler qcc options instead
of “#pragma pack()” ?

“nilton montemurro” <nilton.montemurro@transport.alstom.com> wrote in
message news:f0sp6p$rbm$1@inn.qnx.com

How can we change the code alignment using compiler qcc options instead
of “#pragma pack()” ?

qcc is for QNX6 not QNX4.

If you are using watcom for QNX4 there is the option -zpx. As for QNX6 I
don’t think gcc support that.

You can use attributes in the structure definition:

http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Type-Attributes.html#Type-Attributes

“nilton montemurro” <> nilton.montemurro@transport.alstom.com> > wrote in
message news:f0sp6p$rbm$> 1@inn.qnx.com> …

How can we change the code alignment using compiler qcc options instead
of “#pragma pack()” ?


qcc is for QNX6 not QNX4.

If you are using watcom for QNX4 there is the option -zpx. As for QNX6 I
don’t think gcc support that.

On 27/04/2007 8:10 AM, nilton montemurro wrote:

How can we change the code alignment using compiler qcc options instead
of “#pragma pack()” ?

In addition to what Kevin said, there is -fpack-struct to pack all
structures (which is almost always not something you want to do), as
well as some other options to control the size of enums and and other
such code generation conventions. Note that many of these options break
binary compatibility (and, as Mario pointed out, apply to Neutrino and
qcc, not qnx4 and Watcom).

http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Code-Gen-Options.html#Code-Gen-Options


Ryan J. Allen
QNX Software Systems