Installation guide

7.3.1.1 Controlling Pointer Size and Allocation
The DIGITAL UNIX system has a set of compiler options and pragmas you
can use to control pointer size and allocation, thereby allowing ULTRIX
applications that may make assumptions about pointers being 32 bits to
more easily migrate to a DIGITAL UNIX environment.
The set of options for the cc command is known as the xtaso option.
Combined with the taso linker option (which is required when the xtaso
option is used), the xtaso option can prevent problems with invalid
addressing and pointer truncation that could occur when migrating
applications with 32-bit pointers to the DIGITAL UNIX system. There are
limits to the use of the xtaso option. First, the option should only be used
in end-user application programs, and not in library programs. Second, the
end-user application should be known to have 32-bit dependencies.
This option is most useful for applications that have already been migrated
to the DIGITAL UNIX system, but exhibit performance problems due to
either memory limitations or the heavy use of dynamic memory allocation.
The elements of the xtaso option are:
#pragma pointer_size
specifier
A C language pragma for controlling pointer size allocation that is
recognized by the compiler, but only acted on when the xtaso option
is specified. This pragma is defined in the Programmer’s Guide manual.
The xtaso and xtaso_short options to the cc command
The xtaso option causes the compiler to respond to the pragmas that
control pointer size allocation. The xtaso_short option forces the
compiler to allocate 32-bit pointers by default.
For more information about these compiler options, see cc
(1).
taso linker option
The linker option that enables correct xtaso support. The xtaso
option allows you to create pointers that are only 32 bits. Because
32-bit pointers cannot represent the entire range of addresses that are
possible in the DIGITAL UNIX system environment, you must make
sure that any programs you compile are linked using the taso option.
For more information, see the following sections.
7.3.1.2 Correcting the Pointer-to-int Assignment Problem
The most portable way to fix the problem presented by pointer-to-int
assignments in existing source code is to modify the code to eliminate this
type of assignment. However, in the case of large applications, this can be
Migrating Your ULTRIX Application to a DIGITAL UNIX System 7–7