HP 3000 Manuals

HP C/iX Enhancements [ COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.0 ] MPE/iX Communicators


COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.0

HP C/iX Enhancements 

by Erryl Johnson 
Systems Technology Division 

16-BIT DATA ALIGNMENT IN STRUCTS AND UNIONS The HP C compiler now allows
data in structs and unions to be aligned on half-word (16-bit)
boundaries.  This capability simplifies transferring data to and from
files and databases created on MPE V that contain half-word aligned data.
The new HP_ALIGN pragma and the new +u command line option implement this
capability.

HP_ALIGN Pragma The HP_ALIGN pragma has two options, MPE_16 and POP. The
MPE_16 option directs the HP C/iX compiler to set the alignment of ints,
floats and doubles, in structs and unions, to be half word aligned.  The
option also sets the alignment of structs and unions to start and end on
at least a half word boundary.  The POP option turns off the HP_ALIGN
pragma and alignment reverts to word (32-bit).  For example:

     #pragma HP_ALIGN MPE_16
     struct { char a; double b; int c; } d;
     #pragma HP_ALIGN POP

+u Command Line Option The +u option causes the compiler to generate code
to access pointers with half-word addressing.  This permits using
pointers to access half-word aligned quantities within structs and
unions.

For more information on these changes, refer to the related article in
the "Technical Articles" section in this Communicator, the HP C/iX 
Reference Manual (31506-90005) and the HP C Programmer's Guide 
(92434-60002).



MPE/iX Communicators