Causes all structures to be mapped as if the UNALIGNED attribute is specified at the level 1 structure level.
The option is for compatibility with versions of DEC VAX PL/I.
Compiling with
-zp1 effectively packs all structures so that any pad bytes used for data alignment are eliminated. This is useful when files
originating from the mainframe have records in which the data items are packed or unaligned.
When
-zp1 is set, the compiler needs to take certain precautions, especially on RISC architectures where misaligned data can cause
a hardware exception.
The
-zp1 compiler options affects the following:
- All structure members are packed without any pad bytes for alignment as if the UNALIGNED attribute were specified at the level
1 structure level.
- All based variables are treated as if unaligned.
- All parameters are treated as if unaligned.
- All Character Varying data items are treated as if unaligned. The Open-PL/I default alignment for CHAR VAR is HALFWORD which
is the natural alignment of the leading fixed bin (15) length.
When using
-zp1, to maintain consistency in passing arguments without modifying the source code, the compiler disables creating dummy arguments
at call points when the argument is a structure member and the argument and parameter descriptors do not explicitly differ
between the UNALIGNED and ALIGNED attributes.
Note: Using
-zp1 can have an overall impact on performance. On RISC architectures such as SPARC and AIX/Power, the compiler must generate
sequences of byte addressable instructions to access unaligned data items in the memory. On Intel, no changes are required
for code generation, but additional clock cycles are required for the hardware to access misaligned data items.