Modifying pointers

Executable and linking format (ELF)-compatible compilers use data attributes to modify the behavior of specific pointers to support your applications in both a 32-bit and 64-bit environment. You can modify pointers to be compatible with low-level storage areas in your z/TPF system by using the PTR32ATT macro (which uses the mode (SI) attribute) or the following data types:
__ptr32_t
explicitly represents 32-bit void pointers.
__chptr32_t
explicitly represents 32-bit char pointers.
__uiptr32_t
explicitly represents 32-bit unsigned pointers.
For single source compatibility, code the following statement:
#include <sys/types.h>
To prevent unexpected results on your z/TPF system when modifying the behavior of pointers:
  • Use the mode(SI) attribute only when the following conditions exist:
    • The assembler DSECT that maps to the pointer cannot be modified from 4 to 8 bytes.
    • The pointer is declared as part of a structure that maps directly to an assembler DSECT.
  • Do not use the mode(SI) attribute when you perform the following tasks:
    • Declare a function pointer.
    • Cast a variable.
    • Declare local pointers, or pointers that do not map to fields in an assembler DSECT.
    • Declare an argument or return value for a function prototype.
    • Pass an argument by reference.