- or a + sign.
Any number of options can be interspersed anywhere in the aCC
command and they are typically separated by blanks.
-Ae Command Line Option Syntax |
-Ae
HP is pleased to provide Partial Support for the new -Ae option, which is not yet fully implemented. This is done to allow our customers the opportunity to begin working with this feature in advance of its full implementation.
Setting the -Ae option turns on ANSI C c89 mode. This means the aC++ compiler will accept c89 compatible C source programs and compile them just like the C compiler. Additional HP ANSI C compiler options may be enabled by this option in the future.
Not all features are enabled in this release. The following is a list of current limitations. Some code that is a warning in C is a fatal error in aC++. JAGad30700 A fatal error occurs when the result of an expression does not match the expected type. int main() { int *i, j; double num = 0; i = # /* perfectly legal */ i = num ; i = 0x40000010 ; return(0); }
Error 203: "bug.c", line 5 # Cannot assign 'int *' with 'double *'.
JAGad30708,
JAGad30710:
K&R style function definitions have structs defined in
function argument declarations, etc.
/*Bug.c */
vararg(arg1, arg2)
int arg1, arg2 ;
{
return(arg1 + arg2);
}
main(){
int i,j;
i = vararg(2, 2);
vararg(1);
vararg(1, 2, 3, 4);
exit(0);
}
/* bug2.c */
void foo(st_var)
struct {int i;} st_var;
{ }
JAGad37764:
Nested struct definition is not visible at file scope.
struct A{
struct B { int i; } *b;
};
void foo(){
struct A *a;
struct B *b;
a->b = b;
}
Error 405: "bug.c", line 8 # Illegal assignment; type 'B *' is not
assignable to type 'A::B *'; 'tentative struct B' is not an
unambiguously derived class of 'struct B'.
a->b = b;
JAGad37765:
C++ reserved words(for example, operator) are not allowed as user
defined variables.
struct A { int operator; };
void foo() {
A a;
a.operator;
}
Error 187: # Referenced object 'operator ' is not
a member of struct A ["test.8.1.C", line 1].
a.operator;
JAGad39135:
ENUM constants result in duplicate symbols at link time.
/* bug.h */
enum { RED=1, GREEN, BLUE } ;
/* bug.c */
#include "bug.h"
extern int foo(void);
main(){
return(foo());
}
/* bug2.c */
#include "bug.h"
int foo(void){
return( RED ) ;
}
/usr/ccs/bin/ld: Duplicate symbol "RED" in files bug.o and bug2.o
/usr/ccs/bin/ld: Duplicate symbol "GREEN" in files bug.o and bug2.o
/usr/ccs/bin/ld: Duplicate symbol "BLUE" in files bug.o and bug2.o
/usr/ccs/bin/ld: Found 3 duplicate symbol(s)
JAGad36435:
-Ae Error 24 on K&R function decl if parm matches a struct name.
struct B { int a, b; };
typedef struct B A;
void foo(A) int A: {}
Unwanted warning while initializing enums with ENUM constants.
enum X { Y };
enum X x = Y;
main(){return;)
warning (anachronism) 440: "bug.c", line 2 #
Cannot initialize 'enum X' with 'int'.
enum X x = Y;
-c Command Line Option Syntax |
-c
The compiler produces an object file (a file ending with
.o) for each source file (a file ending with .c, .C, .s,
or .i). Note that you must eventually link object files before they
can be executed.
aCC -c sub.C prog.C
Compiles sub.C and prog.C and puts the relocatable object code in the
files sub.o and prog.o, respectively.
+DAarchitecture Command Line Option Syntax |
+DAarchitecturearchitecture can be one of the following:
2.0 or 1.1)
+DAportable to generate code compatible
across 1.1 and 2.0 workstations and servers.)
2.0N (Use +DA2.0N to specify 32-bit narrow mode
for the PA-RISC 2.0 architecture.
This is the new name for 2.0 on 64-bit systems.
This is the default on 64-bit systems.)
2.0W (Use +DA2.0W to specify 64-bit wide mode for the PA-RISC 2.0
architecture. This option is specific to the PA-RISC 2.0 architecture.)
When +DA2.0W is specified:
__LP64__ is defined.
/opt/langtools/lib/sched.models file for a list of
model numbers and their PA-RISC architecture designations.
-lm.
(See the HP-UX Floating-Point Guide for more information about using math libraries.)
NOTE: Object code generated for PA-RISC 2.0 will not execute on PA-RISC 1.1 systems.
To generate code compatible across PA-RISC 1.1 and 2.0 workstations
and servers, use the +DAportable option.
For best
performance use +DA with the model number or architecture
where you plan to execute the program.
If you do not specify a +DA option, the default code generation is based on that of the system on which you compile.
If you specify neither a +DA nor a +DS option, default instruction scheduling is based on that of the system on which you compile. If you do specify a +DA option and do not specify a +DS option, default instruction scheduling is based on what you specify in +DA, and not based on that of the system on which you compile.
For example, specify +DA1.1 and do not specify +DS, and instruction scheduling will be for 1.1. Specify +DAportable and do not specify +DS, and instruction scheduling will be for 1.1. (+DAportable is currently equivalent to +DA1.1.)
/opt/langtools/lib/sched.models for model numbers and their
architectures. Use the command uname -m to determine the model number
of your system.
The instruction set on PA-RISC 2.0 is a superset of the instruction set on PA-RISC 1.1. Code generated for HP 9000 PA-RISC 1.1 systems will run on HP 9000 PA-RISC 2.0 systems, though possibly less efficiently than if it were specifically generated for PA-RISC 2.0.
Code generated for PA-RISC 2.0 will not run on PA-RISC 1.1 systems.
When you use the +DA option depends on your particular circumstances.
+DA.
+DAarchitecture with the model number of the target system.
For example, if you are compiling on a 720 and your program will run on an
855, use +DA855.
+DAportable.
+DDdata_model Command Line Option Syntax |
+DDdata_modeldata_model can be one of the following:
| ILP32 Data Model | LP64 Data Model |
|---|---|
| The size of an int, long, or pointer data type is 32-bits. | The size of an int data type is 32-bits. The size of a long or pointer data type is 64-bits. |
| This is the default, currently equivalent to +DA1.1 architecture. | This is currently equivalent to +DA2.OW architecture. |
The preprocessor predefined macro, __LP64__
is defined.
|
Note that 64-bit object code (LP64) is generated for PA-RISC 2.0, and will not execute on PA-RISC 1.1 systems.
aCC +DD64 app.CThe following example generates code for the 32-bit data model.
aCC app.C
+DOosname Command Line Option Syntax |
+DOosnameosname can be one of the following:
If +DO11.0EP9806 and +Olibcalls are both specified on an HP-UX 11.0EP9806 system, the compiler enables the fusing of libcalls where applicable. This promotes instruction level parallelism in library routines which can improve performance by computing the same function (such as sin) of two values concurrently. This becomes particularly significant in the presense of loop unrolling.
+DO can be used at any level of optimization.
CAUTION: Use of +DO makes the resulting code binary incompatible with earlier versions of HP-UX.
aCC +DO11.0EP9806 +Olibcalls app.CThe following examples generate code for any HP-UX operating system and do not enable the fusing of libcalls:
aCC +DO11.0 +Olibcalls app.C aCC app.C
+DSmodel Command Line Option Syntax |
+DSmodelmodel can be either a model number of an HP 9000 system (such as 725, 890, or G40), PA-RISC architecture designation 1.1 or 2.0, or one of the PA-RISC processor names such as PA7000, PA7100, PA7100LC, or PA8000. See the file
/opt/langtools/lib/sched.models for model numbers and
processor names.
Object code with scheduling tuned for a particular model will execute on other HP 9000 systems, although possibly less efficiently.
If you specify neither a +DA nor a +DS option, default instruction scheduling is based on that of the system on which you compile. If you do specify a +DA option and do not specify a +DS option, default instruction scheduling is based on what you specify in +DA, and not based on that of the system on which you compile.
For example, specify +DA1.1 and do not specify +DS, and instruction scheduling will be for 1.1. Specify +DAportable and do not specify +DS, and instruction scheduling will be for 1.1. (+DAportable is currently equivalent to +DA1.1.)
If you plan to run your program on both PA-RISC 1.1 and 2.0 systems, use the +DS2.0 designation.
+DS720
+DS745
+DSPA8000
/opt/langtools/lib/sched.models for model numbers and their processor
names. Use the command uname -m to determine the model number of
your system.
By default, the compiler performs scheduling tuned for the system on which you
are compiling, or, if specified, tuned for the setting of the
+DA option.
Use the +DS option to change this default behavior and
to specify instruction scheduling tuned to a particular
implementation of PA-RISC. For example, to specify instruction scheduling
for the model 867, use +DS867. To specify instruction scheduling for the
PA-RISC 8000 processor, use +DSPA8000. See the file
/opt/langtools/lib/sched.models for model numbers and processor names.
When you use the +DS option depends on your particular circumstances.
+DS option. The compiler
generates code tuned for your system.
+DSmodel with either the model number of the target system or
the processor name of the target system.
For example, if you are compiling on a system with a PA7100 processor and your
program will run on a system with a PA7100LC processor, you can use
+DSPA7100LC. This will give you the best performance
on the PA7100LC system.
+Olit Command Line Option Syntax |
+Olit=kind
+Olit=all is the default in aCC and +Olit=const
is the default in C.
+Olit=kind The defined values for kind are:
all
All string literals and all const-qualified
variables that do not require load-time or
run-time initialization will be placed in a
read-only data section. +Olit=all replaces the
deprecated +ESlit option.
none
No constants are placed in a read-only data
section. +Olit=none replaces the deprecated
+ESnolit option.
+k Command Line Option Syntax |
+k
If your program references a large amount of global data in shared libraries,
the default code generation for referencing that global data may not be
sufficient. If this is the case, when you link your program the linker
gives an error message indicating that you need to recompile with the +k
option. The +k option generates long-displacement code sequences so
a program can reference large amounts of global data in shared libraries.
Use +k only when the linker generates a message indicating you need to
do so.
aCC +k prog.C mylib.sl
Compiles prog.C, generates code for accessing a large number of global
data items in the shared library mylib.sl, and links with mylib.sl.
+Oprefetch_latency Command Line Option Syntax |
+Oprefetch_latency=cycles
+Oprefetch_latency applies to loops for which the compiler
generates data prefetch instructions.
cycles represents the number of cycles for a data cache miss.
For a given loop, the compiler divides cycles by the estimated
cycles must be in the range of 0 to 10000.
A value of zero instructs the compiler to use the default value,
which is 480 cycles for loops containing floating-point accesses
and 150 cycles for loops that do not contain any floating-point
accesses.
For tuning purposes, it is recommended that users measure their application's performance using a few different prefetch latency settings to determine the optimal value. Some floating-point codes may benefit by increasing the distance to 960. Parallel applications frequently benefit from a shorter prefetch distance of 150.
+Oprofile Command Line Option Syntax |
+Oprofile=[use|collect]
+Oprofile=collect is equivalent to +I.
+Oprofile=use[:filename] causes the compiler to look
for a profile
database file. Overrides the FLOW_DATA environment variable. This
option is a synonym for +df and
+P.
After compiling and linking with +Oprofile=collect, run the
resultant program
using representative input data to collect execution profile data.
Finally, recompile with the +Oprofile=use option
to perform profile-based optimization.
Profile data is stored in flow.data by default. See the
+Oprofile=use:filename option for information on
controlling the name and location of this data file.
aCC +Oprofile=collect -O -c prog.C aCC +Oprofile=collect -O -o prog.pbo prog.oCompiles
prog.C with optimization, prepares the object code
for data collection, and creates the executable file prog.pbo.
Running prog.pbo
collects run-time information in the file flow.data in
preparation for optimization with +Oprofile=use.
+Oprofile=collect [:<qualifiers>]
In the absence of <qualifiers>, +Oprofile=collect is same as +I.
<qualifiers> are a comma-separated list of profile collection qualifiers.
Supported profile collection qualifiers:
arc - Collect arc counts (synonym to +Oprofile=collect).
This is the default value.
stride - Collect stride data
all - Collect all types of profile data.
It's a synonym for +Oprofile=collect:arc,stride
Interactions and dependencies are not changes with respect to +Oprofile=collect.
+tmtarget Command Line Option Syntax |
+tmtarget
+tm target option implies
+DAarchitecture and
+DSmodel
settings as described in the following table.
| specified target value | +DAarchitecture implied | +DSmodel implied |
|---|---|---|
| K7200 | 1.1 |
1.1 |
| K8000 | 2.0 | 2.0 |
| V2200 | 2.0 | 2.0 |
NOTE:
If you specify +DA or +DS on the aCC
command line, your setting takes precedence over the setting implied by
+tm target.
+tm target at
optimization levels 0, 1, 2, 3, and 4.
The default target
value corresponds to the machine on which you invoke the compiler.
-S Command Line Option Syntax |
-S
.s suffix.
CAUTION:
The -S option is informational only. Generated output is not
meant to be used as input to the assembler (as).
aCC -S prog.C
Compiles prog.C to assembly code rather than to object code, and puts the
assembly code in the file prog.s.
+hugesize=n Command Line Option Syntax |
+hugesize=n[M][K]
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 allocated in huge data subspace.
The number of elements that can be declared in an array depends on the data type of the array. The following table lists current object size limits in 32-bit (narrow) mode:
| Data Structure | Maximum Number of Elements in an Array of this Type |
|---|---|
| char arrays | 2^28 |
| float and 32-bit integer arrays | (2^28)/4 |
| double and 64-bit integer arrays | (2^28)/8 |
| long double arrays | (2^28)/16 |
| structs/unions | based on element size |
Note that limits in 64-bit mode are based on hardware, OS or resource limitations. The compiler itself allows higher limits.
Refer also to Default Data Storage and Alignment
aCC +DA2.0W +hugesize=8M app1.C app2.C
+unum Command Line Option Syntax |
+unum
The +u option allows pointers to access non-natively aligned data. This option alters the way that the compiler accesses dereferenced data. Use of this option may reduce the efficiency of generated code. num can be specified as:
aCC +u1 app.C
Data storage refers to the size of data types, such as bool, short,
int, float, and char*.
Data alignment refers to the way the HP aC++ compiler
aligns data structures in memory. Data type alignment and storage differences
can cause problems when moving data between systems that have different
alignment and storage schemes. These differences become apparent when
a structure is exchanged between systems using files or inter-process
communication. In addition, misaligned data addresses can cause bus errors
when an attempt is made to dereference the address.
The following table lists the sizes and alignments of HP aC++ data types:
| Data Type | Size in Bytes | Alignment |
|---|---|---|
| bool | 1 | 1-byte |
| char, unsigned char, signed char | 1 | 1 |
| wchar_t | 4 | 4 |
| short, unsigned short, signed short | 2 | 2 |
| int, unsigned int | 4 | 4 |
| long, unsigned long | 4 * | 4 * |
| float | 4 | 4 |
| double | 8 | 8 |
| long double | 16 | 8 ** |
| long long, unsigned long long | 8 | 8 |
| enum | 4 | 4 |
| arrays | size of array element type | alignment of array element type |
| struct | *** | 1-, 2-, 4-, or 8-byte |
| union | *** | 1-, 2-, 4-, or 8-byte |
| bit-fields | size of declared type | alignment of declared type |
| pointer | 4 * | 4 * |
* In 64-bit mode, long, unsigned long, and pointer data types are 8 bytes long and 8-byte aligned.
** In 64-bit mode, long double is 16-byte aligned.
*** struct and union alignment is the same as the strictest alignment of any member. Padding is done to a multiple of the alignment size.
+d Command Line Option Syntax |
+d
This option is useful when you are debugging your code because you cannot set breakpoints at inline functions. This option defeats inlining thereby allowing you to set breakpoints at functions specified as inline.
-g Command Line Option Syntax |
-g
-g causes the compiler to
generate minimal information for the debugger.
It uses an algorithm that attempts to reduce duplication of debug information.
To suppress expansion of inline functions use the +d option.
-g0 Command Line Option Syntax |
-g0
To suppress expansion of inline functions use the +d option.
-g1 Command Line Option Syntax |
-g1
-g1 causes the compiler to
generate minimal information for the debugger.
It uses an algorithm that attempts to reduce
duplication of debug information.
To suppress expansion of inline functions use the +d option.
-g0 option emits full debug information about every
class referenced in a file, which can result in some redundant information.
The -g and -g1 options, on the other hand, emit a subset of this debug information, thereby decreasing the size of your object file. If you compile your entire application with -g or -g1 no debugger functionality is lost.
NOTE: If you compile part of an application with -g or -g1 and part with debug off, (that is, with neither the -g, the -g0, nor the -g1 option) the resulting executable may not contain complete debug information. You will still be able to run the executable, but in the debugger, some classes may appear to have no members.
Use -g0 when either of the following is true:
NOTE: If you compile part of an application with -g or -g1 and part with debug off, (that is, with neither the -g, the -g0, nor the -g1 option) the resulting executable may not contain complete debug information. You will still be able to run the executable, but in the debugger, some classes may appear to have no members.
If there are no virtual member functions, the compiler looks for the first non-inline member function.
If there are no non-inline member functions, debug information is always generated.
A problem occurs if all functions are inline;
in this case, no debug information is generated.
+[no]objdebug Command Line Option Syntax |
+[no]objdebug
CAUTION: With +objdebug, the object files or archive libraries must not be removed.
+noobjdebug is the default at compile time and is the same as versions of the compiler prior to A.01.15. +objdebug is the default at link time.
If +noobjdebug is used at link time (not the default), all debug information goes into the executable, even if some objects were compiled with +objdebug. This can be used to enforce the debugging paradigm prior to HP aC++ version A.01.15.
If +objdebug is used at compile time, extra debug information is placed into each object file to help the debugger locate the object file and to quickly find global types and constants.
Use +[no]objdebug with the -g, -g0, or -g1 option.
+p Command Line Option Syntax |
+p
Ordinarily, the compiler gives warnings about anachronistic constructs. Using
the +p option, the compiler gives errors for anachronistic constructs.
aCC +p file.CCompiles
file.C and gives errors for all anachronistic constructs rather
than just giving warnings.
-w Command Line Option Syntax |
-w
By default, HP aC++ reports all errors and warnings.
aCC -w file.CCompiles
file.C and reports errors but does not report any warnings.
+w Command Line Option Syntax |
+w
The default is to warn only about constructs that are almost certainly problems.
For example, this option warns you when calls to inline functions cannot be expanded inline.
aCC +w file.CCompiles
file.C and warns about both questionable constructs and
constructs almost certainly problematic.
+W args Command Line Option Syntax |
+W arg1[,arg2,..argn]
aCC +W600 app.C
+We args Command Line Option Syntax |
+We arg1[,arg2,..argn]
aCC +We 600,829 app.C
+noeh Command Line Option Syntax |
+noeh
Disables exception handling.
By default, exception handling is on. To turn off exception handling, you must use this option. With exception handling disabled, the keywords throw and try elicit an error.
Note that if your application throws no exceptions, code compiled with and without +noeh can be mixed freely. However, the mixing of code compiled with and without +noeh in an application which throws exceptions is unsupported.
aCC +noeh progex.CCompiles and links
progex.C, which does not use exception handling.
-ext Command Line Option Syntax |
-ext
-ext, you are enabling the following HP aC++
extensions to the C++ standard:
| HP aC++ Extentions |
|---|
Enable 64-bit integer data type support for:
Use this option to declare 64-bit integer literals and for input and output of 64-bit integers. |
Enable #assert and
#unassert
preprocessor directives allowing
you to set a predicate name or predicate name and token to be tested with a
#if directive.
|
Note, when using -ext, specify it at both compile and link time.
aCC -ext foo.C
Compiles foo.C which contains a long long declaration.
#include <iostream.h>void main(){ long long ll = 1; cout << ll << endl; }
+FPflags Command Line Option Syntax |
+FP[flags]
flags is a series of upper case or lower case letters from the set [VvZzOoUuIiDd] with no spaces, tabs, nor other characters between them. If the upper-case letter is selected, that behavior is enabled. If the lower-case letter is selected or if the letter is not present in the flags, the behavior is disabled. By default, all traps are disabled. The values for flags are:
| flag | Meaning |
|---|---|
| V | Enable traps on invalid floating-point operations. |
| v | Disable traps on invalid floating-point operations. |
| Z | Enable traps on divide by zero. (If your program must conform to the POSIX standard, do not enable this trap.) |
| z | Disable traps on divide by zero. |
| O | Enables traps on floating-point overflow. |
| o | Disable traps on floating-point overflow. |
| U | Enable traps on floating-point underflow. |
| u | Disable traps on floating-point underflow. |
| I | Enable traps on floating-point operations that produce inexact results. |
| i | Disable traps on floating-point operations that produce inexact results. |
| D | Enable fast underflow (flush to zero) of denormalized values. (Enabling fast underflow is an undefined operation on PA-RISC 1.0 based systems, but it is defined on all subsequent versions of PA-RISC. Selecting this value enables fast underflow only if it is available on the processor that is used at run time.) |
| d | Disable fast underflow (flush to zero) of denormalized values. |
To dynamically change these settings at run time, refer to fpgetround(3M). Also see fesettrapenable(3) or fenv(5).
#include files.
-Idirectory Command Line Option Syntax |
-I directory
directory is the HP-UX directory where HP aC++ looks for header files.
#include files during preprocessing.
During the link phase, adds directory to the directories to be
searched for #include files by the link-time template processor.
For #include files that are enclosed in double quotes
(" ")
within a source file and do not begin with a /, the preprocessor searches in
the following order:
#include.
-I option.
For #include files that are enclosed in angle brackets (< >), the
preprocessor searches in the following order:
-I option.
(The current directory is not searched when angle brackets (< >)
are used with #include.)
aCC -I /opt/aCC/include/SC file.C
This example directs HP aC++ to search in the directory
/opt/aCC/include/SC for #include files.
-I- Command Line Option Syntax |
[-Idirs] -I- [-Idirs][-Idirs] indicates an optional list of -Idirectory specifications in which a directory name cannot begin with a hyphen (-) character.
Specifying -I- serves a dual purpose, as follows:
(" ")
file names in a #include directive to the following order:
-I option.
The preprocessor does not search the directory of the including file.
Angle-bracket enclosed file names in a #include directive are searched for only in the -I directories specified after -I- on the command-line. Quoted includes are searched for in the directories that both precede and succeed the -I- option.
Without view-pathing, there is no way to completely replace the default -Idirectory search-path with one customized specifically for project development.
With view-pathing, you can designate and separate official directories from development directories and enforce an unconventional search-path order. For quote enclosed headers, the preprocessor can include any header files located in development directories and, in the absence of these, include headers located in the official directories.
If -I- is not specified view-pathing is turned off. This is the default.
aCC -Idir1 -Idir2 -c a.CWith view-pathing on, the following example searches for quoted include files in dir1 first and dir2 next, followed by the standard include directories, ignoring the directory of a.C. Angle-bracketed includes are searched for in dir2 first, followed by the standard include directories.
aCC -Idir1 -I- -Idir2 -c a.CCAUTION: Some of the compiler's header files are included using double quotes. Since the -I- option redefines the search order of such includes, if any standard headers are used, it is your responsibility to supply the standard include directories (/opt/aCC/include and /usr/include) in the correct order in your -I- command line.
For example, when using -I- on the aCC command line, any specified -I directory containing a quoted include file having the same name as an HP-UX system header file, may cause the following possible conflict. (In general, if your application includes no header having the same name as an HP-UX system header, there is no chance of a conflict.)
Suppose you are compiling program a.C with view-pathing on. a.C includes the file a.out.h which is a system header in /usr/include:
aCC -IDevelopmentDir -I- -IOfficialDir a.CIf a.C contains:
// This is the file a.C #include <a.out.h> // ...When a.out.h is preprocessed from the /usr/include directory, it includes other files that are quote included (like #include "filehdr.h").
Since with view-pathing, quote enclosed headers are not searched for in the including file's directory, filehdr.h which is included by a.out.h will not be searched for in a.out.h's directory (/usr/include). Instead, for the above command line, it is first searched for in DevelopmentDir, then in OfficialDir and if it is found in neither, it is finally searched for in the standard include directories (/opt/aCC/include and /usr/include) in the latter of which it will be found.
However, if you have a file named filehdr.h in DevelopmentDir or OfficialDir, that file (the wrong file) will be found.
+help Command Line Option Syntax |
+help
If +help is used on any command line, the compiler displays the online programmer's guide with the default web browser and then processes any other arguments.
If $DISPLAY is set, the default web browser is displayed.
If the display variable is not set, a message so indicates.
Set your $DISPLAY variable as follows:
export DISPLAY=YourDisplayAddress (ksh shell notation) setenv DISPLAY YourDisplayAddress (csh shell notation)
export BROWSER=AlternateBrowserLocation
To invoke the online guide:
aCC +help
+inline_level [i]num Command Line Option Syntax |
+inline_level [i]num
This option controls how C++ inlining hints influence HP aC++. Such inlining happens in addition to explicitly inlined functions. By default, this option is off.
Specifying i causes implicit inlining of small functions.
Specify num as 0, 1, 2, or 3. Refer to the tables below.
Note that +d and
+inline_level 0 turn off all
inlining, including implicit inlining.
| num | Meaning |
|---|---|
| 0 | No inlining is done (same effect as the +d option). |
| 1 | Only small functions are inlined. |
| 2 | Only large functions are not inlined. |
| 3 | Inlining hints are respected in all cases, except when the called function is recursive or when it has a variable number of arguments. |
The default level depends on +Oopt as shown in the following table:
| opt | num |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 2 |
| 3 | 2 |
| 4 | 2 |
NOTE: This option controls functions declared with the inline keyword or within the class declaration and is effective at all optimization levels.
The options +O[no]inline and +Oinlinebudget control the high level optimizer that recognizes other opportunities in the same source file (+O3) or amongst all source files (+O4).
aCC +inline_level3 app.C
+A Command Line Option Syntax |
+A
The -a,archive linker
option also links archive libraries but it links the shared library
/usr/lib/libdld.sl. +A links in
/opt/aCC/lib/cxxshl.o instead of /usr/lib/libdld.sl.
In 64-bit mode, /opt/aCC/lib/cxxshl.o is not used.
aCC +A file.o -lmLinks
file.o and links in the archived version of the math library,
/lib/libm.a, rather than the shared version,
/lib/libm.sl,
and does not link in /usr/lib/libdld.sl.
-a linker option
-b Command Line Option Syntax |
-b
The object files must have been created with the +z or +Z option to generate position-independent code (PIC).
aCC -b utils.o -o utils.sl
Links utils.o (which must have been created using the +z option)
and creates the shared library utils.sl.
-lname Command Line Option Syntax |
-lnameThe name parameter forms part of the name of the library the linker searchs when looking for routines called by your program.
/usr/lib/libname.sl
/usr/lib/libname.a
/opt/langtools/lib/libname.sl
/opt/langtools/lib/libname.a
.sl) or the archive
library (.a) depends on the value of the
-a linker option or the
+A compiler option.
NOTE:
Because a library is searched when its name is encountered, placement of a
-l is significant. If a file contains an unresolved external reference,
the library containing the definition must be placed after the file
on the command line. For details refer to the description of ld
in the HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
aCC file.o -lnumeric
This example directs the linker to link file.o and (by default)
search the library /usr/lib/libnumeric.sl.
-Ldirectory Command Line Option Syntax |
-LdirectoryThe directory parameter is the HP-UX directory where you want the linker to search for libraries your program uses before searching the default directories.
The default search path is the directory /opt/aCC/lib.
The -L option must precede any -lname
option entry on the command line; otherwise -L is ignored.
This option is passed directly to the linker.
aCC -L/project/libs prog.C -lmylib1 -lmylib2
Compiles and links prog.C and directs the linker to search the directories
/opt/aCC/lib and /project/libs for any libraries that prog.C uses
(in this case, mylib1 and mylib2).
+z Command Line Option Syntax |
+z
Use -b to create a shared library.
+z is similar to the +Z option.
Use +z
unless the linker generates an error message indicating that you should
use +Z.
The -G option is ignored if either +z or
+Z is used.
aCC -c +z utils.C
Compiles utils.C and generates position-independent code in utils.o.
utils.o can be placed into a shared library with the -b option.
+nostl Command Line Option Syntax |
+nostl
+nostl suppresses linking of all default -Idirectory and -Ldirectory paths and some of the -lname libraries (-lstd and -lstream). Use the -v option to see the effect of +nostl.
CAUTION: Complete understanding of the linking process and the behavior of the actual (third party) libraries linked with the application is essential for avoiding link or run-time failures.
+Z Command Line Option Syntax |
+Z
Use -b to create a shared library.
+Z is the same as the +z option except that it allows
for more imported symbols than does +z.
Use the +Z option only if errors are generated when you use +z.
The -G option is ignored if either +z
or +Z is used.
64-bit Mode Only: +Z is the default when +DA2.0W is specified.
In addition, you can use the -Wl,args compiler option to specify any linker option on the compiler command line. For more information on linker options, see the ld(1) man page or the HP-UX Reference Manual.
CAUTION: You must use the aCC command to link your HP aC++ programs and libraries. This ensures that all libraries and other files needed by the linker are available.
-n Command Line Option Syntax |
-n
ld in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-N Command Line Option Syntax |
-N
Unsharable executable files generated with the -N option cannot
be executed with exec.
ld description in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-q Command Line Option Syntax |
-q
ld in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-Q Command Line Option Syntax |
-Q
-s Command Line Option Syntax |
-s
Specifying this option prevents using a symbolic debugger on the resulting program.
ld in the HP-UX Reference Manual or
the ld(1) man page if it is installed on your system.
(If you see the message "Man page could not be formatted," ensure the man page
is installed.)
-o Command Line Option Syntax |
-o outfile
The outfile parameter is the name of the file containing the
output of the compilation.
Without this option the default name is a.out.
When compiling a single source file with the -c
option, you can use the -o option to specify the name and location of the
object file.
-.suffix Command Line Option Syntax |
-.suffixThe suffix parameter represents the character or characters to be used as the output file name suffix.
suffix cannot be the same as the original source file name suffix.
.c file.
aCC -E -.i prog.C
Preprocesses the C++ code in prog.C and puts the resulting code
in the file prog.i.
-Y Command Line Option Syntax |
-Y
The language value (refer to environ(5) for the LANG environment
variable) is used to initialize the correct tables for interpreting
comments, string literals, and character constants. The language value
is also used to build the path name to the proper message catalog.
hpnls, lang, and environ in the
HP-UX Reference Manual for a description of the NLS model.
-z Command Line Option Syntax |
-z
Fatal errors result if null pointers are dereferenced.
If you attempt to dereference a null pointer, a SIGSEGV
error occurs at run time.
aCC -z file.CCompiles
file.C and generates code to disallow dereferencing of null
pointers.
To use optimization, first specify the appropriate basic optimization level
(+O1, +O2, +O3, or +O4)
on the aCC command line followed by one or more
finer or more precise options when necessary.
For an introduction with examples, refer to
Optimizing HP aC++ Programs.
Categories of options are listed below.
-O Command Line Option Syntax |
-O
aCC -O prog.CCompiles
prog.C and optimizes at level 2.
+O1 Command Line Option Syntax |
+O1
aCC +O1 prog.CCompiles
prog.C and optimizes at level 1.
+O2 Command Line Option Syntax |
+O2
aCC +O2 prog.CCompiles
prog.C and optimizes at level 2.
+O3 Command Line Option Syntax |
+O3
aCC +O3 prog.CCompiles
prog.C and optimizes at level 3.
+O4 Command Line Option Syntax |
+O4
When you link a program, the compiler brings all modules that were
compiled at optimization level 4 into virtual memory at the same time.
Depending on the size and number of the modules, compiling at +O4 can
consume a large amount of virtual memory. If you are linking a
large program that was compiled with the +O4 option,
you may notice a system slow down. In the worst case,
you may see an error indicating that you have run out of memory.
If you run out of memory when compiling at +04 optimization, there
are several things you can do:
+O4 only those
modules that need to be compiled at optimization level 4, and compile
the remaining modules at a lower level.
maxdsiz process parameter from 64 MB to 128 MB.
This procedure provides the process with additional data space.
Refer to the System Administration Tasks manual, Chapter 11,
"Reconfiguring the HP-UX Kernel." See Appendix A for full
descriptions of the different process parameters, including
maxdsiz.
For a complete discussion of swap space, refer to How HP-UX Works: Concepts for the System Administrator.
aCC +O4 prog.CCompiles
prog.C and optimizes at level 4.
+ESfic Command Line Option Syntax |
+ESfic
Replaces millicode calls with inline fast indirect calls.
The +ESfic compiler option affects how function
pointers are dereferenced in generated code. The default is to generate
low-level millicode calls for function pointer calls.
The +ESfic option generates code that calls function pointers
directly, by branching through them.
NOTE:
The +ESfic option should only be used in an environment where there
are no dependencies on shared libraries. The application must be linked
with archive libraries only. Using this option can improve
run-time performance.
+ES[no]lit Command Line Option Syntax |
+ES[no]lit
In A.03.15, A.01.23, and prior compiler versions, only floating-point constant
values were placed in read-only memory. Other constants and literals
were placed in read-write memory.
This behavior remains available by specifying the +ESnolit
option when compiling.
As +ESlit allows the placement of string literals into
read-only memory, all users of an application share this data.
Whereas, each user is allocated a private copy of
the data stored in read-write memory. By moving additional
data from read-write storage to read-only storage,
overall system memory requirements can be reduced and run-time speed improved.
In addition, the compiler may also group identical strings, further reducing
memory usage.
NOTE:
When +ESlit is in effect, you should not attempt to modify
string literals, because all string literals are placed in read-only memory.
Particularly, the following C library functions should be used with care,
since they can alter the contents of a string literal
that is specified as the receiving string.
extern char *strncat(char *, const char *, size_t); extern void *memmove(void *, const void *, size_t); extern char *strcpy(char *, const char *); extern char *strncpy(char *, const char *, size_t); extern char *strcat(char *, const char *); extern char *strtok(char *, const char *);Following is an example of code that attempts to modify read-only memory. A compile-time error is generated unless a cast is done, in which case there is no message. At runtime, a SIGBUS signal is generated.
int main()
{
static const char *p = "Now is the time";
char *q;
// .....
q = (char*)p; // cast to q
// OR
// q = const_cast(p); // const cast to q
*q = 'd'; // Very bad! Application core dump
// .....
}
+ESplabel Command Line Option Syntax |
+ESplabel
+ESplabel option affects how function
pointers are dereferenced in generated code. The default is to generate
low-level millicode calls for function pointer calls (and virtual calls).
+ESplabel generates code that calls function pointers
directly by inlining the millicode routine.
The option can only be used:
In contrast to the +ESfic option,
the application must NOT be linked with only
archive libraries (+A).
+ESsfc Command Line Option Syntax |
+ESsfc
Replaces millicode calls with inline code when performing simple function
pointer comparisons. The +ESsfc compiler option affects how function
pointers are compared in generated code. The default is to generate
low-level millicode calls for function pointer comparisons.
The +ESsfc option generates code that compares function pointers
directly, as if they were simple integers.
NOTE:
The +ESsfc option should only be used in an environment where there
are no dependencies on shared libraries. The application must be linked
with archive libraries only. Using this option can improve run-time
performance.
Following is an example of a code fragment that performs function pointer comparisons:
int (*g)( );
int (*f)( );
int foo ( );
{
. . .
}
. . .
if (f == g)
. . .
if (f == foo)
. . .
if (f == SIG_ERR) /* SIG_ERR is defined in signal.h */
. . .
+O[no]all Command Line Option Syntax |
+O[no]all
+Oall to obtain the best possible performance.
This option should be used with stable, well-structured code. These optimizations give you the fastest code, but are riskier than the default optimizations.
You can use +Oall at optimization levels 2, 3, and 4.
The default is +Onoall.
aCC +Oall prog.CCompiles
prog.C and optimizes for best performance.
aCC -O +Oall prog.CCompiles
prog.C and optimizes at level 2 with aggressive optimizations
and unrestricted compile time.
+Oall option without +O2, +O3, or +O4 combines the following options:
+O[no]aggressive Command Line Option Syntax |
+O[no]aggressive
The +Oaggressive option enables aggressive optimizations.
The +Onoaggressive option disables aggressive optimizations.
Aggressive optimizations can result in significant performance improvement, but can change program behavior. They can:
Use +Oaggressive with optimization levels 2, 3, or 4.
By default, aggressive optimizations are turned off.
aCC +O2 +Oaggressive sourcefile.Cor:
aCC +O3 +Oaggressive sourcefile.Cor:
aCC +O4 +Oaggressive sourcefile.C
+Oaggressive option invokes the following advanced optimization
options:
+O[no]clone Command Line Option Syntax |
+O[no]clone
Cloning is on by default, and is valid at optimization levels +O3 and +O4. When inlining is turned off, cloning is turned off too.
+O[no]conservative Command Line Option Syntax |
+O[no]conservative
+Oconservative option causes the optimizer to make conservative
assumptions about application code and enable only
conservative optimizations, a subset of basic optimizations.
Use +Oconservative at optimization levels 2, 3, or 4 when your source code
is unstructured or you are unfamiliar with the source code being optimized.
The default is +Onoconservative.
+Oconservative option as follows:
aCC +O2 +Oconservative sourcefile.Cor:
aCC +O3 +Oconservative sourcefile.Cor:
aCC +O4 +Oconservative sourcefile.C
+O[no]exception Command Line Option Syntax |
+O[no]exception
+Oexception is allowed to be used at optimization levels 2,3 and 4.
The default is +Onoexception
+O[no]memory[=malloc] Command Line Option Syntax |
+O[no]memory[=malloc]
+O[no]limit Command Line Option Syntax |
+O[no]limit
+Olimit option suppresses optimizations that significantly
increase compile-time or that consume a lot of memory.
The +Onolimit option enables optimizations regardless of their effect
on compile time or memory consumption.
Use +Onolimit with optimization levels 2, 3, or 4.
The default is +Olimit.
+Onolimit as follows:
aCC +O2 +Onolimit sourcefile.Cor:
aCC +O3 +Onolimit sourcefile.Cor:
aCC +O4 +Onolimit sourcefile.C
+O[no]ptrs_to_globals(list) Command Line Option Syntax |
+O[no]ptrs_to_globals(list)
+Onoptrs_to_globals.
+O[no]size Command Line Option Syntax |
+O[no]size
+Osize option suppresses
those few optimizations that significantly increase code size.
The +Onosize option enables code-expanding optimizations.
Use +Osize at optimization levels 2, 3, or 4. The default is +Onosize.
+Osize as follows:
aCC +O2 +Osize sourcefile.Cor:
aCC +O3 +Osize sourcefile.Cor:
aCC +O4 +Osize sourcefile.C
Advanced optimization options provide additional control for special situations.
+O[no]dataprefetch Command Line Option Syntax |
+O[no]dataprefetch
+Odataprefetch is enabled, the optimizer inserts instructions within
innermost loops to explicitly prefetch data from memory into the data cache.
Data prefetch instructions are inserted only for data structures referenced
within innermost loops using simple loop varying addresses (that is,
in a simple arithmetic progression). It is only available for PA-RISC 2.0
targets.
Use this option for applications that have high data cache miss overhead.
You can use +Odataprefetch at optimization levels 2, 3, and 4.
The default is +Onodataprefetch.
+O[no]entrysched Command Line Option Syntax |
+O[no]entrysched
+Oentrysched option optimizes instruction scheduling on a procedure's
entry and exit sequences.
Enabling this option can speed up an
application. The option has undefined behavior for applications which
handle asynchronous interrupts. The option affects unwinding in the entry
and exit regions.
At optimization level +O2 and higher (using dataflow information), save and restore operations become more efficient.
This option can change the behavior of programs that perform
error handling or that handle asynchronous interrupts.
The behavior of setjmp() and longjmp() is not affected.
Use +Oentrysched at optimization levels 2, 3, or 4.
The default is +Onoentrysched.
+O[no]extern Command Line Option Syntax |
+O[no]extern
64-bit Mode Only: Use +Onoextern only with the 64-bit runtime model.
NOTE: Use of +Onoextern creates code that cannot be included in a shared library. Use +Onoextern only to build executables.
Only internal symbols (defined in the load module) can be optimized. If +Onoextern is specified, the compiler assumes that no symbols are external to the load module being compiled, and any symbol can be optimized. If +Oextern is specified, the compiler assumes that all symbols are external to the load module being compiled and thus cannot be optimized; this is the default.
Use +O[no]extern at optimization levels 0, 1, 2, 3, or 4.
The default is +Oextern with no name list.
+O[no]failsafe Command Line Option Syntax |
+O[no]failsafe
+Ofailsafe option allows compilations with internal
optimization errors to continue by issuing a warning message and restarting
the compilation at a lower optimization level or at +O0, as
shown in the following table.
| Specified
Optimization Level |
Optimization Level when Errors Encountered | |
|---|---|---|
| 1 | 0 | |
| 2 | 0 | |
| 3 | 2 (Note that further errors at level 2, cause the optimization level to drop to 0.) | |
| 4 | 2 (Note that further errors at level 2, cause the optimization level to drop to 0.) |
You can use +Onofailsafe at optimization levels 1, 2, 3, or 4
when you want the internal optimization errors to abort your build.
The default is +Ofailsafe at levels 1, 2, 3, 4.
+O[no]fastaccess Command Line Option Syntax |
+O[no]fastaccess
+Ofastaccess option optimizes for fast access to global data items.
Use +Ofastaccess to improve execution speed at the expense of longer
compile times.
Use +Ofastaccess at optimization levels 0, 1, 2, 3, or 4.
The default is +Onofastaccess at optimization levels 0, 1, 2, and 3, and
+Ofastaccess at optimization level 4.
+O[no]fltacc Command Line Option Syntax |
+O[no]fltacc
+Onofltacc also generates Fused Multiply-Add (FMA)
instructions, as does compiling your program at
optimization level 2 or higher. FMA instructions
can improve performance of floating-point applications and are
available only on PA-RISC 2.0 systems or later.
If you specify neither +Ofltacc nor +Onofltacc,
less optimization is performed than for +Onofltacc.
If you specify neither option at optimization level 2 or higher, the
optimizer generates FMA instructions but does
not perform any expression-reordering optimizations.
Specifying +Ofltacc
insures the same result as in unoptimized code (+O0).
+Onofltacc option allows the compiler to make transformations
which are algebraically correct, but which may slightly affect the
result of computations due to the inherent imperfection of computer
floating-point arithmetic.
For many programs, the results obtained under +Onofltacc are
adequately similar to those obtained without the optimization.
For applications
in which roundoff error has been carefully studied, and the order of
computation carefully crafted to control error, +Onofltacc
may be unsatisfactory.
To insure the same result as in unoptimized code, use +Ofltacc.
Use +Onofltacc at optimization levels 2, 3, or 4.
The default is to leave this option unspecified.
+Onofltacc allows the compiler to substitute division by a
multiplication using the reciprocal. For example, the following code
for (int j=1;j<5;j++)
a[j] = b[j] / x;
is transformed as follows (note that x is invariant in the loop):
x_inv = 1.0/x;
for (int j=1;j<5;j++)
a[j] = b[j] * x_inv;
Since multiplication is considerably faster than division, the optimized program runs faster.
+O[no]initcheck Command Line Option Syntax |
+O[no]initcheck
+Oinitcheck), the optimizer initializes to zero any local,
scalar, non-static variables that are uninitialized with respect to at least
one path leading to a use of the variable.
+Onoinitcheck), the optimizer does not initialize uninitialized
variables, but issues warning messages when it discovers them.
Use +Oinitcheck to look for program variables that may not be
initialized.
Use +Oinitcheck at any optimization level and +Onoinitcheck at
optimization levels 2, 3, or 4.
+O[no]inline Command Line Option Syntax |
+O[no]inline
+Oinline option indicates that any function can be inlined by the
optimizer. +Onoinline disables inlining of functions by the optimizer.
(This option does not affect functions inlined at the source code level.
Use +Onoinline at optimization levels 3 or 4.
The default is +Onoinline at optimization levels 1 and 2 and
+Oinline at levels 3 and 4.
+Oinlinebudget Command Line Option Syntax |
+Oinlinebudget=n
The +Oinlinebudget option controls the aggressiveness of
inlining
according to the value you specify for n
where n is an integer in the range 1 - 1000000 that specifies the
level of aggressiveness, as follows:
The +Onolimit and
+Osize
options also affect inlining.
Specifying the +Onolimit option has the same effect
as specifying +Oinlinebudget=200.
The +Osize option has the same effect as
+Oinlinebudget=1.
Note, however, that the +Oinlinebudget option takes
precedence over both of these options.
This means that
you can override the effect of +Onolimit
or +Osize option on inlining
by specifying the +Oinlinebudget option on the same compile line.
Use this option at optimization level 3 or higher.
The default is +Oinlinebudget=100.
See also the
+O[no]inline option.
+Olevel=name1[,name2,...,nameN] Command Line Option Syntax |
+Olevel=name1[,name2,...,nameN]
Currently only the C++ mangled name of the function is allowed for name.
This option works as does the OPT_LEVEL pragma. The option overrides the pragma for the specified functions. As with the pragma, you can only lower the level of optimization; you cannot raise it above the level specified by a basic +Olevel or -O option. To avoid confusion, it is best to use either this option or the OPT_LEVEL pragma rather than both.
You can use this option at optimization levels 1, 2, 3, and 4. The default is to optimize all functions at the level specified by the basic +Olevel or -O option.
aCC +O3 +O1=myfunc1,myfunc2 funcs.c main.cThe following command optimizes all functions at level 2, except for the functions myfunc1 and myfunc2, which it optimizes at level 0.
aCC -O +O0=myfunc1,myfunc2 funcs.c main.c
+O[no]libcalls Command Line Option Syntax |
+O[no]libcalls
errno and do not give an error
message in the event of an exception.
The +Olibcalls option provides access to millicode routines
for the following math library calls:
sin cos tan atan2 pow log10 asin acos atan exp log
Use +Olibcalls to improve the performance of these library routines
only when you do not want standard error checking. For example, you
might use +Olibcalls with code that has already been debugged and runs
without error.
The default is +Onolibcalls.
Use +O[no]libcalls at any optimization level.
+O[no]looptransform Command Line Option Syntax |
+O[no]looptransform
The +O[no]looptransform option enables [disables] transformation of
eligible loops for improved cache performance. The most important
transformation is the reordering of nested loops to make the inner loop
unit stride, resulting in fewer cache misses.
The default is +Olooptransform at optimization levels 3 and 4.
You cannot use the option at levels 0-2.
+O[no]loopunroll Command Line Option Syntax |
+O[no]loopunroll[=unroll factor]
+Oloopunroll option turns on loop unrolling.
When you use +Oloopunroll, you can also use the unroll factor
to control the code expansion. The default unroll factor is 4,
that is, four copies of the loop body. By experimenting with different
factors, you may improve the performance of your program.
You can use +Oloopunroll at optimization levels 2, 3, and 4.
The default is +Oloopunroll.
+O[no]moveflops Command Line Option Syntax |
+O[no]moveflops
+Omoveflops option allows moving conditional floating-point
instructions out of loops. The behavior of floating-point error handling may
be altered by this option.
This option also allows you to enable or disable replacing integer divide by a floating-point multiply. This may cause SIGFPE if IEEE inexact is enabled (+FPI).
+Onomoveflops if floating-point traps are enabled and you do not
want the behavior of floating-point errors to be altered by the relocation
of floating-point instructions.
Use +Onomoveflops at optimization levels 2, 3, and 4.
The default is +Omoveflops.
+O[no]multiprocessor Command Line Option Syntax |
+O[no]multiprocessor
Use +O[no]multiprocessor at optimization levels 2, 3, and 4. The default is +Onomultiprocessor.
+O[no]parmsoverlap Command Line Option Syntax |
+O[no]parmsoverlap
+Oparmsoverlap option optimizes with the assumption that the actual
arguments of function calls overlap in memory.
Use +Onoparmsoverlap if C++ programs have been literally translated
from FORTRAN programs.
Use +Onoparmsoverlap at optimization levels 2, 3, and 4.
The default is +Oparmsoverlap.
+O[no]pipeline Command Line Option Syntax |
+O[no]pipeline
+Opipeline option enables software pipelining.
Use +Onopipeline to conserve code space.
Use +Onopipeline at optimization levels 2, 3, and 4.
The default is +Onopipeline at optimization level 1 and +Opipeline at
levels 2, 3, and 4.
+O[no]procelim Command Line Option Syntax |
+O[no]procelim
Used when linking an executable file, +Oprocelim removes functions not
referenced by the application.
Used when building a shared library, +Oprocelim removes
functions not exported and not referenced from within the shared library.
This may be especially useful when functions have been inlined.
Note that any function having symbolic debug information associated with it is not removed.
The default is +Onoprocelim at optimization levels 1 through 3 and
+Oprocelim at level 4.
Use +O[no]procelim at any optimization level.
+O[no]promote_indirect_calls
+O[no]promote_indirect_calls Command Line Option Syntax |
+O[no]promote_indirect_calls
In all cases the optimized code tests to
make sure the direct call is being taken and if not, executes the indirect
call. If +Oinline is in effect,
the optimizer may also inline the promoted calls.
+Opromote_indirect_calls is only effective with
profile-based optimization.
NOTE: The optimizer tries to determine the most likely target of indirect calls. If the profile data is incomplete or ambiguous, the optimizer may not select the best target. If this happens, your code's performance may decrease.
This option can be used at optimization levels 3 and 4. At +O3, it is only effective if indirect calls from functions within a file are mostly to target functions within the same file. This is because +O3 optimizes only within a file whereas, +O4 optimizes across files.
The default is +Onopromote_indirect_calls.
+O[no]regionsched Command Line Option Syntax |
+O[no]regionsched
+Oregionsched option applies aggressive scheduling techniques to move
instructions across branches.
NOTE:
This option is incompatible with the -z option.
Using this option with -z may cause a SIGSEGV error at run-time.
See signal(2) and signal(5) for more information.
(If you see the message "Man page could not be formatted," ensure
the man page is installed.)
Use +Oregionsched to improve application run-time speed.
Use +Oregionsched at optimization levels 2, 3, and 4.
The default is +Onoregionsched.
+O[no]regreassoc Command Line Option Syntax |
+O[no]regreassoc
+Onoregreassoc option turns off register reassociation.
Use +Onoregreassoc to disable register reassociation
if this optimization hinders application performance.
Use +Onoregreassoc at optimization levels 2, 3, and 4.
The default is +Oregreassoc.
+Oreusedir=DirectoryPath Command Line Option Syntax |
+Oreusedir=DirectoryPath
When you compile with +I, +P, or +O4, the compiler generates intermediate code in the object file. Otherwise, the compiler generates regular object code in the object file. When you link, the linker first compiles the intermediate object code to regular object code, then links the object code. With this option you can reduce link time on subsequent links by not recompiling intermediate object files that have already been compiled to regular object code and have not changed.
NOTE: When you do change a source file or command line options and recompile, a new intermediate object file will be created and compiled to regular object code in the specified directory. The previous object file in the directory will not be removed. You should periodically remove this directory or the old object files since the old object files cannot be reused and will not be automatically removed.
Use +Oreusedir=DirectoryPath at optimization
level 4 or with profile-based optimization.
The default is to use TMPDIR and remove the temporary objects after each link.
+O[no]volatile Command Line Option Syntax |
+O[no]volatile
+Ovolatile option implies that memory references to global
variables are volatile and cannot be removed during optimization.
The +Onovolatile option implies that all globals are not of
volatile class. This means that references to global variables can be
removed during optimization.
Use this option to control the "volatile" semantics for all global variables.
Use +Ovolatile at optimization levels 1, 2, 3, or 4.
The default is +Onovolatile.
-mt Command Line Option Syntax |
Description:
Easier use of threads with -mt The new -mt option enables multi-threading capability without the need to set any other flags, such as -l and -D. aC++ examines your environment and automatically selects and sets the appropriate flags. There are four possible sets of flags depending on your operating system and which libstd you use. Option matrix for -mt: | OS 10.20 (user thread) | OS 11.x (kernel thread) ---------+--------------------------------+------------------------------- old-lib | -D_REENTRANT | -D_REENTRANT libstd | -DRW_MULTI_THREAD | -DRW_MULTI_THREAD 1.2.1 | -DRWSTD_MULTI_THREAD | -DRWSTD_MULTI_THREAD | -D_THREAD_SAFE | -D_THREAD_SAFE & | | -D_POSIX_C_SOURCE=199506L librwtool| | 7.0.x | -lcma | -lpthread ---------+--------------------------------+-------------------------------- new-lib | -D_REENTRANT | -D_REENTRANT (-AA) | -D_RW_MULTI_THREAD | -D_RW_MULTI_THREAD | -D_RWSTD_MULTI_THREAD | -D_RWSTD_MULTI_THREAD libstd | | -D_POSIX_C_SOURCE=199506L 2.2.1 | | | -lcma | -lpthread ---------+--------------------------------+-------------------------------- Macros used to compile multi-thread source code: _REENTRANT Required by system header files that provide reentrant functions (suffixed by _r). RW_MULTI_THREAD/_RW_MULTI_THREAD Required by Rogue Wave toolsh++ header files and libraries. RW_MULTI_THREAD is used by toolsh++ 7.0.x. _RW_MULTI_THREAD is used by toolsh++ 8.x (not yet available). RWSTD_MULTI_THREAD/_RWSTD_MULTI_THREAD Required by Rogue Wave standard library header files and libraries. RWSTD_MULTI_THREAD is used by libstd 1.2.1. _RWSTD_MULTI_THREAD is used by libstd 2.2.1 when compiling with -AA. _POSIX_C_SOURCE=199506L Required by pthread. Using -D__HPACC_THREAD_SAFE_RB_TREE The Rogue Wave Standard C++ Library 1.2.1 (libstd) and Tools.h++ 7.0.6 (librwtool) are not thread safe if the underlying implementation rb_tree class is involved. In other words, if the tree header file (which includes tree.cc) under /opt/aCC/include/ is used, these libraries are not thread safe. Most likely, it is indirectly referenced by including the standard C++ library container class map or set headers, or by including a RogueWave tools.h++ header like tvset.h, tpmset.h, tpmset.h, tvset.h, tvmset.h, tvmset.h, tpmap.h, Since changing the rb_tree implementation to make it thread safe would break binary compatibility, the preprocessing macro __HPACC_THREAD_SAFE_RB_TREE must be defined. Whether or not this macro is defined when compiling a file that includes the tree header, its use must be consistent. For example, a new object file compiled with the macro defined should not be linked with older ones that were compiled without the macro defined. Library providers whose library is built with the macro defined may need to notify their users to also compile their source with the macro defined when the tree header is included. This macro is not set by -mt, You must set it explicitly on the command line. _THREAD_SAFE Required by thread safe cfront compatible libstream header files and library. For the frequently used objects cout, cin, cerr, and clog, you can specify the -D_THREAD_SAFE compile time flag for any file that includes. In this case, a new instance of the object is transparently created for each thread that uses it. All instances share the same file descriptor. libcma.* User thread library used in 10.20 system. libpthread.* Kernel thread library used on 11.x systems.
+O[no]autopar Command Line Option Syntax |
+O[no]autopar
+Oparallel
option, +Oautopar
causes the compiler to parallelize loops that are safe to parallelize.
When used with +Oparallel, +Onoautopar causes
the compiler not to parallelize any loops.
A loop is safe to parallelize if it has an iteration count that can be determined at runtime before loop invocation; it must contain no loop-carried dependences, procedure calls, or I/O operations. A loop-carried dependence exists when one iteration of a loop assigns a value to an address that is referenced or assigned on another iteration.
+Oautopar is the default for all optimization levels but is useful only at levels 3 and 4.
+O[no]dynsel Command Line Option Syntax |
+O[no]dynsel
+Oparallel,
the +Odynsel option
enables workload-based dynamic selection of parallelizable loops.
+Odynsel causes the compiler to generate either a
parallel or a serial version of the loop.
The loop's workload is compared to parallelization overhead,
and the parallel version is run only if it is profitable to do so.
The +Onodynsel option disables dynamic selection
and tells the compiler that it is profitable
to parallelize all parallelizable loops.
If a loop's iteration count is known at compile time, this optimization is performed at compile time. If a loop's iteration count is not known until runtime, the optimization is performed at runtime.
The default is +Odynsel if +Oparallel is enabled
at optimization level(s) 3 and 4.
+O[no]loop_block Command Line Option Syntax |
+O[no]loop_block
+O[no]loop_block option enables [disables] blocking
of eligible loops for improved cache performance.
The default is +Onoloop_block at optimization level(s) 3 and 4.
+O[no]loop_unroll_jam Command Line Option Syntax |
+O[no]loop_unroll_jam
+O[no]loop_unroll_jam option enables [disables]
loop unrolling and jamming.
Loop unrolling and jamming increase register exploitation.
The default is +Onoloop_unroll_jam
at optimization level(s) 3 and 4.
+O[no]parallel Command Line Option Syntax |
+O[no]parallel
The default is +Onoparallel at optimization level(s) 3 and 4.
NOTE: If you compile one or more files in an application using +Oparallel, the application must be linked (using the aCC compiler driver) with the +Oparallel option in order to link in the proper start-up files and runtime support.
Use the MP_NUMBER_OF_THREADS environment variable, to specify the number of processors used in executing your parallel programs. This variable is read by your program at runtime. If set to a positive integer n, your program executes on n processors. n must be less than or equal to the number of processors on the system where the program is executing.
For introductory examples, see Setting the Number of Threads Used in Parallel and Transforming Loops for Parallel Execution (+Oparallel).
NOTE: +Oparallel disables the +Ofailsafe option.
+O[no]report[=report_type] Command Line Option Syntax |
+O[no]report[=report_type]
This option causes the compiler to display various optimization reports. The value of report_type determines which report is displayed, as described below:
+Oreport=loop produces the Loop Report which gives
information on optimizations performed on loops and calls.
+Oreport (without = report_type) also
produces the Loop Report.
+Oreport=private produces the Loop Report and the
Privatization Table, which provides information on loop
variables that are privatized by the compiler.
+Oreport=all produces all reports.
The +Onoreport option does not accept any of
the report_type values.
The +Oreport[=report_type] option is active only
at optimization levels 3 and above.
The default is +Onoreport.
+O[no]sharedgra Command Line Option Syntax |
+O[no]sharedgra
+Onosharedgra option enables [disables] global register
allocation for shared-memory variables that are visible to multiple
threads. This option may help if a variable shared among
parallel threads is causing wrong answers.
The default is +Osharedgra. This option is available at optimization levels 2 and above.
Profile-based optimization is a set of performance-improving code transformations based on the run-time characteristics of your application.
+dfname Command Line Option Syntax |
+dfname
The profile database by default is named flow.data. This file stores
profile information for one or more executables.
Use +df when the flow.data file has been renamed or is in a different
directory than where you are linking.
You can also use the FLOW_DATA environment variable to specify a different
path and file name for the profile database file. The +dfname
command line option takes precedence over the FLOW_DATA environment
variable.
NOTE:
The +dfname option cannot be used to redirect the
instrumentation output (with the +I option). It is only compatible
with the +P option.
aCC +P +dfpbo.data prog.o -o myapp
Relinks the object file prog.o, optimizes using the run-time
profile data in the file pbo.data, and
puts the executable code in the file myapp.
+I Command Line Option Syntax |
+I
After compiling and linking with +I, run the resultant program
using representative input data to collect execution profile data.
Finally, relink with the +P option
to perform profile-based optimization.
Profile data is stored in flow.data by default. See the
+dfname option for information on
controlling the name and location of this data file.
The +I option is incompatible with the
-G,
+P,
and -S options.
And it is incompatible with
-g0 and
-g1
if used to compile.
aCC +I -O -c prog.C aCC +I -O -o prog.pbo prog.o
Compiles prog.C with optimization, prepares the object code for data
collection, and creates the executable file prog.pbo. Running prog.pbo
collects run-time information in the file flow.data in preparation for
optimization with +P.
+P Command Line Option Syntax |
+P
The +P option does not affect the default optimization level, or the
optimization level specified by the +O1,
+O2, +O3, or
+O4 options.
NOTE:
Source files that are compiled with the
+I option
do not need to be recompiled with +P
in order to use profile-based optimization. You only need to relink
the object files with the +P option after running the
instrumented version of the program.
The +P option is incompatible with the
+I
and -S options.
And it is incompatible
-g0
and -g1
if used to compile.
aCC +P -o myapp prog.o
Relinks the object file prog.o and optimizes using the run-time profile
data.
+pgmname Command Line Option Syntax |
+pgmname
Specifies a program name to look up in the flow.data file to use with
profile-based optimization and the +P option.
The +pgmname option should be used when the name of the
profiled executable differs from the name of the current executable
specified by the -o option.
In the following example, the instrumented program file name
is sample.inst. The optimized program file name is sample.opt.
The +pgmname option is used to pass the instrumented program name,
sample.inst, to the optimizer:
aCC -c +I sample.C aCC -o sample.inst +I -O sample.o sample.inst < input.file1 aCC -o sample.opt +P +pgm sample.inst sample.o
+O[no]info Command Line Option Syntax |
+O[no]info
+Oinfo displays informational messages about the optimization process.
This option may be helpful in understanding what optimizations are occurring.
You can use the option at levels 0-4.
The default is +Onoinfo at levels 0-4.
-fast Command Line Option Syntax |
-fast
NOTE: Do not use this option for programs that depend on IEEE standard floating-point denormalized numbers. Otherwise, different numerical results may occur.
+uc Command Line Option Syntax |
+uc
NOTE: Since all unqualified char types in the compilation unit will be affected by this option (including those headers that define external and system interfaces) it is necessary to compile the interfaces used in a single program uniformly.
Note that the mechanisms cannot be mixed.
+hdr_cache Option Syntax |
+hdr_cache
An aCC_cache subdirectory is created to contain precompiled header files. By default, it is in the source file directory. To specify a different aCC_cache location and/or name, use the +hdr_dir option.
+hdr_cache can only be used when actually compiling a source file. If used with -P or -E, it is turned off.
aCC -c +hdr_cache header.C main.C
// Precompile and cache header.C and main.C
// (initial compile).
aCC -c +hdr_cache header.C main.C
// header.C and main.C are not precompiled
// (if no changes to compilation environment).
Note that the -c option is needed to suppress the link step.
+hdr_dir DirectoryPath Option Syntax |
+hdr_dir DirectoryPath
NOTE: To maximize the efficiency of the cache mechanism, it is recommended that you specify a directory in the compilation directory or in a subdirectory of the compilation directory.
aCC -c +hdr_cache header.C // Precompile and cache header.C
// in the aCC_cache directory,
// a subdirectory of that
// in which header.C is located.
aCC -c -Ddebugflag +hdr_cache +hdr_dir ./debug/aCC_debug_cache header.C
// Precompile and cache header.C
// in the ./debug/aCC_debug_cache directory,
// a subdirectory of that
// in which header.C is located.
aCC -c +hdr_cache +hdr_dir ./release/aCC_release_cache header.C
// Precompile and cache header.C
// in the ./release/aCC_release_cache
// directory, a subdirectory of that
// in which header.C is located.
+hdr_info Option Syntax |
+hdr_info
+hdr_create Command Line Option Syntax |
+hdr_create
You can reduce compilation time by precompiling common include (header) files into a precompiled header file.
aCC headers.C -c +hdr_create precomp>From headers.C, creates a precompiled header file named precomp.
Note that the -c option is needed to suppress the link step.
+hdr_use Command Line Option Syntax |
+hdr_use
This is known as a load compile.
aCC main.C +hdr_use precompCompiles main.C, including a precompiled header file named precomp.
+hdr_v Command Line Option Syntax |
+hdr_v
aCC headers.C -c +hdr_create precomp +hdr_vCreates a precompiled header file named precomp and displays what is going into the precompiled header file.
aCC main.C +hdr_use precomp +hdr_vCompiles main.C and displays what is being used from the precompiled header file.
stdout.
.i file.
.suffix.
-Dname Command Line Option Syntax |
-Dname[=def]
name is the symbol name that is defined for the preprocessor.
def is the definition of the symbol name (name).
#define.
If no definition (def) is given, the name is defined as "1".
aCC -DDEBUGFLAG file.C
Defines the preprocessor symbol DEBUGFLAG and gives it the value 1.
Following is a program that uses this symbol.
#include <iostream.h>
void main(){
int i, j;
#ifdef DEBUGFLAG
int call_count=0;
#endif
...
}
-E Command Line Option Syntax |
-E
stdout).
Note an exception to this rule when -E is used with either the
+m[d]
or
+M[d]
option, only make(1) dependency information is output.
Unlike the -P option, the output of -E contains #line entries indicating the original file and line numbers.
+m[d] Command Line Option Syntax |
+m[d]
If +md is specified, the list is directed to a .d file. The .d file name prefix is the same as that of the object file. The .d file is created in the same directory as the object file.
Used with the -E option, only dependency information is generated.
| command line specified | .d file name | .d file location | preprocessing output |
|---|---|---|---|
| aCC -c +m a.C | none | stdout | none |
| aCC -c -E -.i +md a.C | a.d | current directory | none |
| aCC -c -P +md a.C -o b.o | b.d | current directory | b.i |
| aCC -c -P +md a.C -o /tmp/c | c.d | /tmp directory | a.i |
+M[d] Command Line Option Syntax |
+M[d]
If +Md is specified, the list is directed to a .d file. The .d file name prefix is the same as that of the object file. The .d file is created in the same directory as the object file.
Used with the -E option, only dependency information is generated.
| command line specified | .d file name | .d file location | preprocessing output |
|---|---|---|---|
| aCC -c +M a.C | none | stdout | none |
| aCC -c -E -.i +Md a.C | a.d | current directory | none |
| aCC -c -P +Md a.C -o b.o | b.d | current directory | b.i |
| aCC -c -P +Md a.C -o /tmp/c | c.d | /tmp directory | a.i |
-notrigraph Command Line Option Syntax |
-notrigraph
In this version of aCC, the -notrigraph option does not invoke the legacy preprocessor and also suppresses the trigraphs from being interpreted.
This option is not recommended. The proper protable solution is to quote the ? as \?.
-P Command Line Option Syntax |
-P
.i.
aCC -P prog.CPreprocesses the file
prog.C leaving the output in the file prog.i.
Does not compile the program.
-Uname Command Line Option Syntax |
-Unamename is the symbol name whose definition is removed from the preprocessor.
A name can be a definition set by HP aC++; these are displayed when you specify the -v option. Or a name can be a definition you have specified with the -D option on the aCC command line.
The -D option has lower precedence than the -U option. Thus, if the same name is used in both a -U option and a -D option, the name is undefined regardless of the order of the options on the command line.
gprof.
CXperf.
CXperf.
-G Command Line Option Syntax |
-G
gprof (to get an execution
profile).
aCC -G file.CCompiles
file.C and creates the executable file a.out
instrumented for use with gprof.
+pa Command Line Option Syntax |
+pa
The +pa option is invalid with the +O4 or +O[no]all optimization options. Also, +pal is incompatible with the +A, -G, and -s options.
+pal Command Line Option Syntax |
+pal
The +pal option is invalid with the +O4 or +O[no]all optimization options. Also, +pal is incompatible with the +A, -G, and -s options.
for statements.
-Aa Command Line Option Syntax |
-Aa
for
scope rules. The option is equivalent to specifying
-Wc,-koenig_lookup,on
and
-Wc,-ansi_for_scope,on.
The default is off.
-AA Command Line Option Syntax |
-AA
The 2.0 library is a new addition to the HP C++ runtime is not compatible with the version 1.2.1 Standard C++ Library previously bundled with HP aC++. HP aC++ will continue support for standard C++ library 1.2.1 without name or location change. Customers should not notice any change when -AA is not used. However, the 1.2.1 library is deprecated and will be replaced by the new library eventually.
If you wish to use the new 2.0 library, you must use the -AA option consistently to compile and link all translation units. Mixing object files within an executable is not supported.
In order to use the new 2.0 library, you must recompile using the -AA option and you may need to apply a runtime and/or header file patch appropriate to your operating system (see list below). You do not need to install the header file patch if you use the A.03.30 compiler. The header file patches are needed for A.03.27, A.03.26, A.03.25, and A.01.27.
You can avoid the binary incompatibility simply by not using the -AA option and foregoing use of the 2.0 library. If you don't use -AA, you should still install the patches. If you do use -AA and you are on A.03.30, the header file patches are included in A.03.30 but you must still install the runtime patches. Then you must recompile and relink any previous -AA application.
HP does not take the creation of binary incompatibilities lightly. When one is created, it is only after a careful consideration of options and ramifications. Our customers want to be able to use the new 2.0 library. Doing this also ensures compatibility with the Multibyte Support Extensions made in the 11i (11.11) release of HP-UX. The A.03.25 version (PHSS_21906) had an incorrect size and mangling for mbstate_t. The 11i defined value is 8 bytes, the libstd_v2 version is 4.
In particular the following template classes are now larger:
std::basic_filebuf<>
std::basic_fstream<>
std::basic_ifstream<>
std::basic_ofstream<>
std::fpos
std::mbstate_t
In addition to the possible silent corruption with this above change
in size, the mangling was changed to better detect this
compatibility problem by changing the name.
std::mbstate_t was changed to just mbstate_t.
std::tm was changed to just tm.
So if you developed on A.03.25 with the beta, A.03.26 on 11i or on 11.0
with the Ecommerce compiler, or A.01.27 for AR1200, or A.03.27 for AR1200,
you will have the following problems if you don't install both the
following header file and runtime library patches:
PHSS_22867 10.x header file
PHSS_22354 10.x runtime
PHSS_22868 11.x header file
PHSS_22543 11.0 runtime
PHSS_22898 11i runtime
Note applications developed on A.01.27 may not have these problems yet
because there never was any runtime patch, except for a beta.
An ordinary program using iostreams experiencing this problem will get
the following unsats:
If existing application runs on new runtime patch:
/usr/lib/dld.sl: Unresolved symbol: do_out__Q2_3std14codecvt_bynameXTwTcTQ2_
3std9mbstate_t_CFRQ2_3std9mbstate_tPCwT2RPCwPcT5RPc (plabel) from a.out_old
/usr/lib/dld.sl: Unresolved symbol: do_in__Q2_3std14codecvt_bynameXTwTcTQ2_
3std9mbstate_t_CFRQ2_3std9mbstate_tPCcT2RPCcPwT5RPw (plabel) from a.out_old
Trying to link with new runtime without new headers:
/usr/ccs/bin/ld: Unsatisfied symbols:
std::codecvt_byname
std::codecvt_byname
Running application linked with new headers on old runtime:
/usr/lib/dld.sl: Unresolved symbol: do_out__Q2_3std14codecvt_
bynameXTwTcT9mbstate_t_CFR9mbstate_tPCwT2RPCwPcT5RPc (code) from a.out_new
/usr/lib/dld.sl: Unresolved symbol: do_in__Q2_3std14codecvt_
bynameXTwTcT9mbstate_t_CFR9mbstate_tPCcT2RPCcPwT5RPw (code) from a.out_new
Trying to link with old runtime with new headers:
/usr/ccs/bin/ld: Unsatisfied symbols:
std::codecvt_byname
std::codecvt_byname
The -Wc,-koenig_lookup,on
and
-Wc,-ansi_for_scope,on options are also set.
In the next example, with the option disabled, the code is illegal,
because it redefines k in (2) when a previous definition (1) is considered to
have occurred in the same scope. With the option enabled
(-Wc,-ansi_for_scope,on), the definition in (1)
is no longer in scope at (2) and thus the definition in
(2) is legal.
This option works in two modes:
If
This case is similar to the previous example, with additional options.
where:
Template Usage:
Causes the compiler to instantiate all template functions and
all static data members and member functions of template classes
defined in a translation unit,
regardless of whether or not they are used,
and to place these instantiations in the resulting object file.
This option allows existing
instantiations in a translation unit to be used by the assigner to satisfy
instantiation requests in other translation units.
NOTE:
Because +inst_all instantiates all templates,
it is essential to have a thorough understanding of your application and
its template usage in order to use +inst_all effectively.
Otherwise, duplicate symbols may result.
Migration Note:
Note that the +inst_all option differs from the
HP C++ -pta option which instantiates
all members of used template classes and all needed template functions.
When you link or create a shared library, if there is more than one
object file on the command line,
the assigner determines which object file is to contain a given instantiation.
To use +inst_auto, you must specify it at both compile-time and when
creating an executable or a shared library.
Note the use of the +inst_close option to
satisfy all needed template instantiations.
Use +inst_close along with the
+inst_auto option to specify
that automatic instantiation
be used to close a set of link units.
This option prevents reinstantiation of any already instantiated templates
in the .o files or libraries on the command line.
Note that the -c option must be used with +inst_close, otherwise an executable
file or (with -b) a shared library is created.
If you want to create a template library that uses templates,
unlike a non-template library, you must instantiate the
templates before linking the library.
NOTE:
If a library is dependent on another template library, that
template library must be on the command line when you close the dependent
library.
If you build an application with the dependent library, the dependee library
should also be used in the link.
For example, you may have many shared libraries attached to an a.out.
And you do not want to list all of these libraries on the -b
command line when you create a shared library. However, you do want to
be sure there are no duplicate symbols.
Without the use of +inst_directed, instantiation information needed by the
assigner is placed in object files even when you have not requested
automatic (assigner) instantiation with
+inst_none.
This restriction does not apply in HP aC++. Therefore, if your code was
written for HP C++ and/or you wish to follow this rule when compiling
with HP aC++, you need to specify the +inst_implicit_include option.
The default extensions in order of precedence are:
User specified extensions must begin with a dot and must not exceed four
characters in total. Any extension that does not follow these rules
causes a warning and is ignored.
These restrictions do not apply in HP aC++. Therefore, if your code was
written for HP C++ and/or you wish to follow the cfront based
HP C++ template definition file naming conventions when compiling
with HP aC++, you need to specify the +inst_include_suffixes option.
If you use +inst_auto to create a shared library from .o files that have
already been closed, you should use +inst_none.
Template instantiation operates on member functions of template classes and
template functions. Use of a template is a call to such a function.
For example:
NOTE:
Because +inst_used instantiates all used templates,
it is essential to have a thorough understanding of your application and
its template usage in order to use +inst_used effectively.
Otherwise, duplicate symbols may result.
+inst_used is essentially equivalent to default compile-time instantiation.
However, if you intend to use the instantiations in a translation unit
(X.C) to satisfy instantiation requests in other translation units,
using the automatic instantiation mechanism, you should specify +inst_used
instead of using the default to compile X.C. For example:
In addition, when the assigner cannot satisfy an instantiation request,
a message stating the reason is generated.
Usage
The standard features enabled by -AA are incompatible
with the older Rogue Wave Standard C++ Library 1.2.1 and Tools.h++ 7.0.6.
All modules must be consistent in using -AA .
Mixing modules compiled with -AA with ones that are not is not supported.
For More Information:
-Wc,-ansi_for_scope,[on][off] Command Line Option Syntax
-Wc,-ansi_for_scope,[on]
[off]
Description:
This option enables or disables the standard scoping rules for
init-declarations in for statements; the scope of the
declaration then ends with the scope of the loop body.
By default, the option is disabled.
Examples:
In the following example, if the option in not enabled (the current default),
the scope of k extends to the end of the body of main() and statement (1) is
valid (and will return zero). With the option enabled,
k is no longer in scope and (1) is an error.
#include
int main() {
int sum = 0;
for (int k = 0; k!=100; ++k) // (1)
sum += k;
for (int k = 100; k!= 0; ++k) // (2)
sum += k;
}
-Wc,-koenig_lookup,[on][off] Command Line Option Syntax
-Wc,-koenig_lookup,[on]
[off]
Description:
This option enables or disables standard argument-dependent lookup rules
(also known as Koenig lookup). It causes functions to be looked up
in the namespaces and classes associated with the types of the
function-call argument.
By default, the option is disabled.
Example:
In the following example, if the option is not enabled (the current default),
the call in main() does not consider declaration (1) and selects (2).
With the option enabled, both declarations are seen, and in this
case overload resolution will select (1).
namespace N {
struct S {};
void f(S const&, int); // (1)
}
void f(N::S const&, long); // (2)
int main() {
N::S x;
f(x, 1);
}
For More Information:
Subprocesses of the Compiler
These options allow you to substitute your own processes in place of the
default HP aC++ subprocesses,
or pass options to HP aC++ subprocesses.
-tx,name Command Line Option Syntax
-tx,name
Description:
Substitutes or inserts subprocess x
using name.
Example:
aCC -ta,/users/sjs/myasmb file.s
Invokes the assembler /users/sjs/myasmb instead of the default assembler
/usr/ccs/bin/as to assemble and link file.s.
For More Information:
-t.
-W allows you to pass
options to subprocesses.)
More Examples of -t
Substituting for c++filt
aCC -tf,/new/bin/c++filt file.C
Compiles file.C and specifies that
/new/bin/c++filt should be used rather than the default
/opt/aCC/bin/c++filt.
Substituting for ctcom
aCC -tC,/users/proj/ctcom file.C
Compiles file.C and specifies that /users/proj/ctcom
should be used instead of the default /opt/aCC/lbin/ctcom.
Substituting for All Subprocesses
aCC -tx,/new/&driver; file.C
Compiles file.C and specifies that the characters /new/aCC should
be used as a prefix to all the subprocesses of HP aC++ For example,
/new/aCC/ctcom runs rather than the default /opt/aCC/lbin/ctcom.
x Parameter
x is one or more identifiers indicating the subprocess or subprocesses.
The value of x can be one or more of the following:
a
as).
b
C (upper case)
ctcom).
f
c++filt).
l
ld).
u
ucomp).
x
name Parameter
This parameter is either the full path name of the executable file that will
be run, or a prefix that will be concatenated to the default path name.
x is a single identifier, name represents the full path
name of the new subprocess. If x is a set of
identifiers, name represents a prefix to which the
standard suffixes are concatenated to construct the
full path names of the new subprocesses.
-Wx,args Command Line Option Syntax
-Wx,arg1[,arg2,..,argn]
Description:
Passes the arguments
arg1 through argn to the
subprocess x of the
compilation. The arguments are of the form:
-argoption[,argvalue]
Example1:
To see which include files led to an error or warning, specify the
-Wc,-diagnose_includes,on option.
aCC -Wc,-diagnose_includes,on file.C
Specify -Wc,-diagnose_includes,off (the default)
to turn the option off.
Example2:
aCC -Wc,-v file.C
Compiles file.C and passes the option -v to the linker.
aCC -Wl,-v file.C
Compiles file.C and passes the option -v to the linker.
For More Information:
-t allows you to substitute
subprocesses in place of the defaults.)
More Examples of -W
Passing Options to the Linker with -W
aCC file.o -Wl,-a,archive -lm
Links file.o and passes the option -a archive to the linker,
indicating that the archive version of the math library
(indicated by -lm)
and all other driver supplied libraries
should be used rather than the default shared library.
Passing Multiple Options to the Linker with -W
aCC -Wl,-a,archive,-m,-v file.o -lm
Links file.o and passes the options -a archive, -m, and -v to
the linker.
-m indicates that a load map should be produced.
-v requests verbose messages from the linker.
argn Parameters
Each argument, arg1, arg2, through argn to the -W option takes
the form:
-argoption[,argvalue]
x Parameter
x is one or more identifiers indicating a subprocess or subprocesses.
The value of x can be one or more of the following:
a
as).
b
C (either upper or lower case)
ctcom).
d
f
c++filt).
l
ld).
Template Options
By using a template option on the aCC command line, you can:
See Also:
+inst_all Command Line Option Syntax
+inst_all
Description:
Usage:
This option is useful when you want to insure the file location of
all templates defined in a given translation unit
(for example, when preparing an object code library for distribution).
Example:
The following example compiles file1.C and places instantiations
in file1.o.
aCC -c +inst_all file1.C
For More Information:
+inst_auto Command Line Option Syntax
+inst_auto
Description:
Requests that the automatic instantiation mechanism instantiate
every template used if it is listed in the corresponding .I file.
All used template functions, all static data members and member functions
of template classes, and all explicit instantiations are instantiated.
Usage:
This option is necessary to insure that an archive library prepared for
distribution is compatible with such a library prepared using the prior
default (assigner) instantiation mechanism. It also facilitates use of the
assigner by the library user. Refer to
Deciding which Mechanism to Use.
Example:
The following example compiles file1.C and file2.C. Instantiations are
placed in either file1.o or file2.o, as determined by the assigner during
the closure operation.
For More Information:
+inst_close Command Line Option Syntax
+inst_close
Description:
Usage:
+inst_close is used when closing a set of
.o files to create a library.
Archive Library Example
To close and create an archive library containing templates, and then link the
library to produce an application, use the following commands:
Shared Library Example
To close and create a shared library containing templates, and then link the
library to produce an application, use the following commands:
NOTE:
If desired, you can append one or more library names to this command line,
indicating that you do not want duplicate instantiations between
any libraries on the command line.
For More Information:
+inst_directed Command Line Option Syntax
+inst_directed
Description:
Indicates to the compiler that no templates
are to be instantiated (except explicit instantiations) and
suppresses assigner output in object files.
Usage:
If you are using only explicit instantiation and have not requested
automatic (assigner) instantiation, specify +inst_directed instead of
+inst_none.
Example:
aCC +inst_directed prog.C
Compiles file.C with the resulting object file containing no
template instantiations, except for any explicit instantiations coded in
your souce file.
For More Information:
+inst_implicit_include Command Line Option Syntax
+inst_implicit_include
Description:
Specifies that the compiler use a process similar to that of the
cfront source rule for locating template definition files.
For the cfront based HP C++ compiler, if you are using default
instantiation (that is, you are not using a map file),
you must have a template definition file for each template declaration file,
and these must have the same file name prefix.
Example:
aCC +inst_implicit_include prog.C
If prog.C includes a template declaration file named template.h, the
compiler assumes a template definition file name determined by the
+inst_include_suffixes option.
For More Information:
+inst_include_suffixes Command Line Option Syntax
+inst_include_suffixes list"
list is a set of space separated file extensions or suffixes,
enclosed in quotes, that template definition files can have.
Description:
Specifies which file name extensions the compiler uses to
locate template definition files. This option must be used with the
+inst_implicit_include option.
".c .C .cxx .CXX .cc .CC .cpp"
Example:
.c or .C.
Migration:
The +inst_include_suffixes option is equivalent to the
HP C++ -ptS option.
For More Information:
+inst_none Command Line Option Syntax
+inst_none
Description:
For automatic (assigner) instantiation, indicates to the compiler that
no templates are to be instantiated (except explicit instantiations).
Usage:
If you know that templates in a translation unit have been instantiated
in another translation unit that will participate in the link,
you might want to use +inst_none to prevent unneeded instantiation attempts.
Example:
aCC +inst_none file.C
Compiles file.C with the resulting object file containing no
template instantiations, except for any explicit instantiations coded in
your souce file.
For More Information:
+inst_used Command Line Option Syntax
+inst_used
Description:
Causes the compiler to instantiate
all template class members and all template functions
that are used in a translation unit
and to place these instantiations in the resulting object file.
Usage:
This option may be useful when compiling a large application or
library containing many templates, only some of which are used.
aCC -c +inst_used X.C
aCC +inst_auto Y.C X.o
Example:
aCC -c +inst_used file.C
Compiles file.C and places instantiations for
all used members of template classes and all used template functions
in file.o.
For More Information:
+inst_v Command Line Option Syntax
+inst_v
Description:
Enables verbose mode, sending a step-by-step description of template processing
to stderr.
+inst_v works with all template processing options except
the default compile-time instantiation mechanism (+inst_compiletime).
Messages are produced when:
Usage:
You can use +inst_v to help determine the locations of errors in instantiation.
Since verbose output tells you where instantiations have been made, you might
also use it to determine the layout of explicit instantiation in applications
that have many modules produced by a number of different developers.
Example:
aCC +inst_auto +inst_v file.C
Compiles file.C and provides details of template processing.
Migration:
The +inst_v option is similar to the HP C++ -ptv option.
For More Information:
Requesting Verbose Compile and Link Information
Use the following options to obtain additional information about:
+dryrun Command Line Option Syntax
+dryrun
Description:
Causes aCC (the driver) to generate subprocess information for a given
command line without running the subprocesses.
Usage:
Useful in the development process to obtain
command lines of compiler subprocesses in order to run the commands manually
or to use them with other tools.
Example:
aCC +dryrun app.C
The above command line gives the same kind of information
as the -v option but without running the subprocesses.
+time Command Line Option Syntax
+time
Description:
This option generates timing information for compiler subprocesses.
For each subprocess, estimated time is generated in seconds for
user processes, system calls, and total processing time.
Usage:
Useful in the development process, for example, when tuning an application's
compile-time performance.
Examples:
The following command line:
aCC +time app.C
generates information like this:
process: compiler 0.94/u 0.65/s 4.35/r
process: ld 0.37/u 0.76/s 3.02/r
The following command line:
aCC -v +time app.C
generates information like this:
/opt/aCC/lbin/ctcom -inst compiletime -diags 523 -D __hppa -D __hpux
-D __unix -D __hp9000s800 -D __STDCPP__ -D __hp9000s700 -D _PA_RISC1_1
-I /opt/aCC/include -I /opt/aCC/include/iostream -I /usr -I
/usr/include -I /usr/include -inline_power 0 app.C
file name: app.C
file size: app.o 444 + 16 + 1 = 461
process user sys real
------------------------------------------
process: compiler 0.93 0.13 1.17
------------------------------------------
line numbers: app.C 7
lines/minute: app.C 396
LPATH=/usr/lib:/usr/lib/pa1.1 :/usr/lib:/opt/langtools/lib:/usr/lib
/opt/aCC/lbin/ld -o a.out /opt/aCC/lib/crt0.o -u ___exit -u main
-L /opt/aCC/lib /opt/aCC/lib/cpprt0.o app.o -lstd -lstream -lCsup -lm
/usr/lib/libcl.a -lc /usr/lib/libdld.sl >/usr/tmp/AAAa28149 2>&1
file size: a.out 42475 + 1676 + 152 = 44303
process user sys real
------------------------------------------
process: ld 0.35 0.24 0.82
------------------------------------------
total link time(user+sys): 0.59
removing /usr/tmp/AAAa28149
removing app.o
-v Command Line Option Syntax
-v
Description:
Enables verbose mode, sending a step-by-step description of the compilation
process to stderr.
Usage:
This is especially useful for debugging or for learning the appropriate
commands for processing a C++ file.
Example:
The following compiles file.C and gives extra information about
the process of compiling.
aCC -v file.C
/opt/aCC/lbin/ctcom -inst compiletime -diags 523 -D __hppa -D __hpux
-D __unix -D __hp9000s800 -D __STDCPP__ -D __hp9000s700 -D _PA_RISC1_1
-I /opt/aCC/include -I /opt/aCC/include/iostream -I /usr -I /usr/include
-I /usr/include -inline_power 0 app.C
LPATH=/usr/lib:/usr/lib/pa1.1
:/usr/lib:/opt/langtools/lib:/usr/lib
/opt/aCC/lbin/ld -o a.out /opt/aCC/lib/crt0.o -u ___exit -u main
-L /opt/aCC/lib /opt/aCC/lib/cpprt0.o app.o -lstd -lstream -lCsup
-lm /usr/lib/libcl.a -lc /usr/lib/libdld.sl >/usr/tmp/AAAa28149 2>&1
removing /usr/tmp/AAAa28149
-V Command Line Option Syntax
-V
Description:
Displays the version numbers of the current compiler and linker
(if the linker is executed).
Usage:
Use this option whenever you need to know the current
compiler and linker version numbers.
Example:
aCC -V app.C
Concatenating Options
You can concatenate some options to the aCC command under a single
prefix. The longest substring that matches an option is used. Only the last
option can take an argument. You can concatenate option arguments with their
options if the resulting string does not match a longer option.
Examples:
Suppose you want to compile my_file.C using the options
-v and -g.
Below are equivalent command lines you could use:
aCC my_file.C -v -g1
aCC my_file.C -vg1
aCC my_file.C -vg1
aCC -vg1 my_file.C