You copied the Doc URL to your clipboard.


Specifies unaligned pointer support required for an application.



Where num is one of:


Accesses through pointers have an alignment of one, that is, byte-aligned or unaligned.


Accesses through pointers have an alignment of at most two, that is, at most halfword aligned.


Accesses through pointers have an alignment of at most four, that is, at most word aligned.


Accesses through pointers have normal alignment, that is, at most doubleword aligned.

If numis unspecified, the compiler faults use of --pointer_alignment.


This option can help you port source code that has been written for architectures without alignment requirements. You can achieve finer control of access to unaligned data, with less impact on the quality of generated code, using the __packed qualifier.


De-aligning pointers might increase the code size, even on processors with unaligned access support. This is because only a subset of the load and store instructions benefit from unaligned access support. The compiler is unable to use multiple-word transfers or coprocessor-memory transfers, including hardware floating-point loads and stores, directly on unaligned memory objects.


  • Code size might increase significantly when compiling for processors without hardware support for unaligned access, for example, pre-v6 architectures.

  • This option does not affect the placement of objects in memory, nor the layout and padding of structures.