+DO allows you to set the
target operating system for the compiler.
As of HP aC++ version A.03.10, uninitialized data objects to a maximum
size of 2^61 bytes are supported for arrays and C style structs
and unions.
HP aC++ versions released on HP-UX 11.x prior to version A.03.10,
support both the 32-bit and 64-bit data models. However, the largest
data objects allowed are limited to a maximum of 2^28 bytes.
What Qualifies as Huge Data
In order for the compiler to qualify a data object as huge, its size must
equal or exceed the current setting of the hugesize threshold.
The threshold is initially set to .5 gigabytes (2^29 bytes).
A data object whose size equals or exceeds the threshold is automatically
allocated in a huge data subspace.
To modify the threshold, use the
+hugesize=n
command line option.
In addition, huge data objects must be:
-
uninitialized arrays, C style structs, or C style unions
-
have a maximum size of 2^61 bytes
-
be compiled in wide mode (+DA2.0W)
NOTE:
Extern aggregate declarations of unknown size are assumed to be huge.
In the following example, the compiler generates code to access Iar as if
it is in huge data subspace whether or not it actually is.
extern int Iar[];
The definition for Iar determines whether the array is huge or small.
What Does Not Qualify as Huge Data
Huge data is not supported:
-
in 32-bit mode
-
for initialized data objects
-
for thread specific objects
-
for automatic objects
-
for C++ structs and classes
-
for passing huge arguments by value
-
for functions returning huge data by value
-
in throw and catch statements
Features Introduced in Prior Releases
The HP aC++ default template instantiation mechanism has changed to
compile-time instantiation (CTTI). For source code containing templates,
the new default may result in faster compile-time processing.
The previous default behavior remains available by specifying the
+inst_auto command-line option when
compiling and linking. If you
provide archive or shared libraries for distribution, you may want
to use +inst_auto to insure consistent behavior between each
distribution of your libraries.
Also, if you provide either archive or shared library products, and your
customers need to use the prior template instantiation default in their
builds, you must build your libraries by using the +inst_auto option.
For More Information
Refer to Using HP aC++ Templates in this
online programmer's guide and to the online
technical document, Using Templates in HP aC++
for details about template instantiation and migration.
HP aC++ A.03.13 on HP-UX 11.00 includes support for both the 32-bit
data model (ILP32) and the 64-bit data model (LP64). For ILP32,
integer, long, and pointer data is 32 bits in size. For LP64, long
and pointer data is 64 bits in size, an integer is 32 bits. The default
target architecture continues to be determined by the host system and
the /opt/langtools/lib/sched.models file. The default compilation mode remains unchanged (32-bit).
The HP-UX 64-bit Porting and Transition Guide includes extensive
32-bit/64-bit information. 64-bit information is also found in the
HP-UX Linker and Libraries Online User Guide and in this HP aC++ Online Programmer's Guide.
- Parameters to the +DA[architecture] option allow
you to compile in either 32-bit mode or 64-bit mode.
+DA2.0N (the updated name for +DA2.0) specifies 32-bit (narrow) mode for the
PA-RISC 2.0 architecture. This is the default on 64-bit systems.
+DA2.0W specifies 64-bit (wide) mode for the PA-RISC 2.0 architecture.
Specifying +DA2.0W generates 64-bit SVR4 Executable and Linking Format
(ELF) object files for PA-RISC 2.0. This option is specific to the
PA-RISC 2.0 architecture.
- By default, the __LP64__ preprocessing macro is defined by the
compiler when processing in 64-bit mode. The compiler defines the
__PA_RISC2_0 macro for PA2.0 in both 32-bit and 64-bit modes.
You can use these macros within conditional directives to isolate
64-bit code.
- 64-bit system libraries are located in /usr/lib/pa20_64.
32-bit libraries remain in /usr/lib.
- The +Z compiler option is the default in 64-bit mode (PIC on). The
default in 32-bit mode remains non-PIC.
For More Information
The size of a class containing any virtual function varies when compiled
in 32-bit mode versus 64-bit mode. The difference in size is caused by
the virtual table pointer (a pointer to an internal compiler table) in
the class object. The pointer is created for any class containing one
or more virtual functions.
When compiling the following example in 32-bit mode, the output is 8.
In 64-bit mode, the output is 16.
extern "C" int printf(const char *,...);
class A {
int a;
public:
virtual void foo(); //virtual function foo, part of class A
};
void A::foo() {
return;
}
int main() {
printf("%d\n",sizeof(A));
}