ILE C/C++ Programmer's Guide
IBM C and C++ compilers convert pointers with attribute __ptr128 to
a pointer with attribute __ptr64 (and vice versa) as needed, based
on function and variable declarations.
Consider the following:
- A pointer with attribute _ptr128 that points to single-level
store (SLS) storage is arbitarily converted to a pointer with attribute
__ptr64.
- Code that is not teraspace-enabled cannot access teraspace.
- Interfaces with pointer-to-pointer parameters require special
handling. See Maintaining Consistent Argument Declarations.
The ILE compilers automatically insert pointer conversions to match pointer
lengths. In the case of multiple level pointers, the conversion is
performed only on the first level of the pointer. For example,
conversions are inserted whenever:
- The pointer arguments to a function do not match the length of the pointer
parameters in the prototype for the function
- Pointers of different lengths are compared
- Note:
- You can specify explicit pointer conversions. See Casting Pointers.
When casting pointers in a teraspace environment, consider the
following:
- A conversion from a 16-byte pointer to an 8-byte pointer works only if the
16-byte pointer contains a teraspace address or a null pointer value.
Otherwise, either a MCH0609 exception condition occurs or an arbitrary
teraspace offset value is returned.
- 16-byte pointers cannot have types converted from one to another, but a
16-byte Open pointer can contain any pointer type. In contrast, no
8-byte Open pointer exists, but 8-byte pointers can be logically converted
between a space pointer and a procedure pointer. Even so, an 8-byte
pointer conversion is just a view of the pointer type, so it does not allow a
space pointer to actually be used as a procedure pointer unless the space
pointer was set to point to a procedure.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.