Command Line Options

You can specify command-line options to the aCC command. They allow you to override the default actions of the compiler. Each option begins with either a - or a + sign. Any number of options can be interspersed anywhere in the aCC command and they are typically separated by blanks. Unless otherwise specified the options are supported by C and C++ compilers.
For a complete list of options, select Alphabetical List of Command Line Options. Otherwise, select a category:

See Also:


Alphabetical List of Command Line Options

Select the option for which you want more information:

Parallel Processing Options

HP aC++ provides the following optimization options for parallel code.

For More Information:

-mt
Automatically selects and sets flags for parallelization.
+O[no]autopar
Parallelize loops that are safe to parallelize.
+O[no]dynsel
Enable workload-based dynamic selection of parallelizable loops.
+O[no]report[=report_type]
Produce a Loop Report.
+tls
Specify thread local storage.

-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:
old-lib
libstd
1.2.1
(-AP)
&
librwtool
7.0.x
-D_REENTRANT
-DRW_MULTI_THREAD
-DRWSTD_MULTI_THREAD
-D_THREAD_SAFE
-D_POSIX_C_SOURCE=199506L
-D_HPUX_SOURCE *
-lpthread
new-lib
(-AA)

libstd
2.2.1

-D_REENTRANT
-D_RW_MULTI_THREAD
-D_RWSTD_MULTI_THREAD
-D_POSIX_C_SOURCE=199506L
-D_HPUX_SOURCE *
-lpthread
C mode
-Ae/-Aa
-D_REENTRANT
-D_POSIX_C_SOURCE_199506L
-lpthread

* required if -D_POSIX_C_SOURCE used

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.
_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.
libpthread.*
Kernel thread library used on 11.x systems

For More Information:

+O[no]autopar Command Line Option Syntax

+O[no]autopar

Description:

When used with the +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.

For More Information:

+O[no]dynsel Command Line Option Syntax

+O[no]dynsel

Description:

When specified with +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.

For More Information:

+O[no]report[=report_type] Command Line Option Syntax

+O[no]report[=report_type]

Description:

This option causes the compiler to display[not to display] various optimization reports.

Usage:

The value of report_type determines which report is displayed, as described below:
      loop
             produces the Loop Report which gives information 
             on optimizations performed on loops and calls.
             +Oreport is equivalent to 
             +Oreport=loop.

      private
             produces the Loop Report and the Privatization Table, 
             which provides information on loop variables that are 
             privatized by the compiler.

      all
             produces all reports.

The +Onoreport option does not accept any of the report_type values and turns off all reporting. The +Oreport[=report_type] option is active only at optimization levels 3 and above. The default is +Onoreport.

For More Information:

+tls=[static|dynamic] Command Line Option Syntax

+tls=[static|dynamic]

Description

Specifies whether references to thread local data items are to be performed according to the mode.

Usage:

+tls=mode 
The defined values of mode are:
   static
         This is a more efficient mode in which only
         thread local data in the program startup set
         can be accessed.

   dynamic
         This is a less efficient mode in which thread
         local data outside the program startup set can
         be accessed as well. This is the default.
Translation units compiled with different settings of this option may be freely mixed, even within the same load module.

Options to Control Code Generation

These options allow you to control what kind of code the compiler generates.
-c
Compile to relocatable object file without linking
+DDdata_model
Generate object code for either the ILP32 or LP64 data model.
+DSmodel
Perform instruction scheduling tuned for a particular architecture.
-S
Compile to assembly language without linking.

-c Command Line Option Syntax

-c

Description:

Compiles one or more source files but does not enter the linking phase.

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.

Example:

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.

+DDdata_model Command Line Option Syntax

+DDdata_model
data_model can be one of the following:

Description:

This option specifies the data model for the compiler.

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.
The preprocessor predefined macro _ILP32 is defined. The preprocessor predefined macro, __LP64__ is defined. Also __LP64__ and _LP64.

Examples:

The following example generates code for the 64-bit data model.
aCC +DD64 app.C
The following example generates code for the 32-bit data model.
aCC app.C

+DSmodel Command Line Option Syntax

+DSmodel
model can be either of four values. The default is blended.
   blended 
           Tune to run reasonably well on multiple
           implementations. As old implementation 
           become less important and new implementations 
           are added, the behavior with this value will 
           change accordingly.
   itanium 
           Tune for the Itanium processor
   itanium2 
           Tune for the Itanium2 processor
   native  
           Tune for the processor on which the 
           compiler is running

Description:

Performs instruction scheduling tuned for a particular implementation of the IPF architecture.

Object code with scheduling tuned for a particular model will execute on other HP 9000 systems, although possibly less efficiently.

Using +DS to Specify Instruction Scheduling

Instruction scheduling is different on different implementations of IPF architectures. You can improve performance on a particular model or processor of the HP 9000 by requesting that the compiler use instruction scheduling tuned to that particular model or processor. Using scheduling for one model or processor does not prevent your program from executing on another model or processor.

When you use the +DS option depends on your particular circumstances.

Compiling in Networked Environments

When compiles are performed using diskless workstations or NFS-mounted file systems, it is important to note that the default code generation and scheduling are based on the local host processor. The system model numbers of the hosts where the source or object files reside do not affect the default code generation and scheduling.

-S Command Line Option Syntax

-S

Description:

Compiles the named program and leaves the assembly language output in a corresponding file with a .s suffix. The -S option is only for displaying the assembler code. The generated code is not intended to be used as input to the assembler (as).

Example:

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.

Symbol Binding

The following -B options are recognized by the compiler to specify whether references to global symbols may be resolved to symbols defined in the current load module, or whether they must be assumed to be potentially resolved to symbols defined in another load module.

A global symbol is one that is visible by name across translation unit boundaries. A static symbol is one that is visible by name only within a single translation unit but is not associated with a particular procedure activation. A locally defined symbol is a global or static symbol with a definition in the translation unit from which it is being referenced.

-Bdefault
Symbols are assigned the default export class.
-Bextern
Inlining of import stubs for calls to default export class symbols.
-Bhidden
Symbols are assigned the hidden export class.
-Bprotected
Symbols assigned the protected export class.
-Bsymbolic
All symbols assigned the protected export class.

-Bdefault Command Line Option Syntax

-Bdefault

Description:

Global symbols are assigned the default export class. These symbols may be imported or exported outside of the current load module. The compiler will access tentative and undefined symbols through the linkage table. Any symbol that is not assigned to another export class through use of another -B option (or the deprecated +O[no]extern option) will have the default export class. The -Bdefault option may also be used on a per symbol basis to specify exceptions to global -Bprotected, -Bhidden, and -Bextern options.

Usage:

-Bdefault=symbol[,symbol...]
The named symbols are assigned the default export class.
-Bdefault:filename
The file indicated by filename contains a list of symbols, separated by spaces or newlines. These symbols are assigned the default export class.

-Bextern Command Line Option Syntax

-Bextern

Description:

The specified symbols, or all undefined symbols if no list is provided, are assigned to default export class. Additionally, the compiler will inline the import stub for calls to these symbols. No compile time binding of these symbols will be done. All references to these symbols will be through the linkage table, so an unnecessary performance penalty will occur if -Bextern is applied to a listed symbol that is resolved in the same load module.

Usage:

-Bextern=symbol[,symbol...]
The named symbols, or all symbols if no list is provided, are assigned the default export class. Use of list form overrides the default binding of locally defined symbols.
 
-Bextern:filename
The file indicated by filename is expected to contain a list of symbols, separated by spaces or newlines. These symbols are assigned the default export class.

-Bhidden Command Line Option Syntax

-Bhidden

Description:

The specified symbols, or all symbols if no symbols are specified, are assigned the hidden export class. The hidden export class is similar to the protected export class. In addition, hidden symbols will not be exported outside the current load module. The linker may eliminate them from a shared library, but in an executable, they remain accessible to the debugger unless +Oprocelim is also specified.

When used with no symbol list, -Bhidden implies -Wl,-aarchive_shared, causing the linker to prefer an archive library over a shared library if one is available. This can be overridden by following the -Bhidden option with a subsequent -Wl,-a option.

Usage:

-Bhidden=symbol[,symbol...]
The named symbols, or all symbols if no symbols are specified, are assigned the hidden export class.
-Bhidden:filename
The file indicated by filename is expected to contain a list of symbols, separated by spaces or newlines. These symbols are assigned the hidden export class.

-Bprotected Command Line Option Syntax

-Bprotected

Description:

The specified symbols, or all symbols if no symbols are specified, are assigned the protected export class. That means these symbols will not be preempted by symbols from other load modules, so the compiler may bypass the linkage table for both code and data references and bind them to locally defined code and data symbols.

When used with no symbol list, -Bprotected implies -Wl,-aarchive_shared, causing the linker to prefer an archive library over a shared library, if one is available. This can be overridden by following the -Bprotected option with a subsequent -Wl,-a option.

Usage:

-Bprotected_data
Marks only data symbols as having the protected export class.
-Bprotected_def
Same as -Bprotected but only locally defined (non-tentative) symbols are assigned the protected export class.
-Bprotected:filename
The file indicated by filename is expected to contain a list of symbols, separated by spaces or newlines. These symbols are assigned the protected export class.
-Bprotected=symbol[,symbol...]
The named symbols, or all symbols if no symbols are specified, are assigned the protected export class.

-Bsymbolic Command Line Option Syntax

-Bsymbolic

Description:

All symbols are assigned the protected export class. Equivalent to -Bprotected with no symbol list.

Data Alignment and Storage

Default Data Storage and Alignment

This section describes default data storage allocation and alignment for HP compiler data types.

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 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 the HP compiler 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
__float80 16 16
__float128 16 16 in +DD64.
8 otherwise.
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-, 8-, or 16-byte
union *** 1-, 2-, 4-, 8-, or 16-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.


Debugging Options

Debugging options enable you to use the HP WDB Debugger.

+d
Disable all inlining of functions.
-g
Generate minimal information for debugging.
-g0
Generate full information for debugging.
-g1
Generate minimal information for debugging.
+[no]objdebug
Generate debug information in object files and not in the executable.

+d Command Line Option Syntax

+d

Description:

Prevents the expansion of inline functions.

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.

See Also:

-g Command Line Option Syntax

-g

Description:

Like the -g1 option, -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.

For More Information:

-g0 Command Line Option Syntax

-g0

Description:

-g0 causes the compiler to generate full debug information for the debugger.

To suppress expansion of inline functions use the +d option.

For More Information:

-g1 Command Line Option Syntax

-g1

Description:

Like the -g option, -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.

For More Information:

Difference between -g, -g0, and -g1

The -g, -g0, and -g1 options all generate debug information. The difference is that the -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.

When to Use -g, -g0, or -g1

Use -g or -g1 when Use -g0 when either of the following is true:

For More Information:

-g, -g1 Algorithm

In general, the compiler looks for the first non-inline, non-pure (non-zero) virtual function in order to emit debug information for a class.

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

Description:

Generate [do not generate] debug information in object files and not in the executable. The HP WDB debugger then reads the object files to construct debugging information.

CAUTION: With +objdebug, the object files or archive libraries must not be removed.

+objdebug is the default at link time and at compile 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.

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.

Usage:

Use +objdebug option to enable faster links and smaller executable file sizes for large applications, rather than +noobjdebug where debug information is written to the executable.

Use +[no]objdebug with the -g, -g0, or -g1 option when using +ild.

For More Information:


Error Handling Options

Use these options to control how potential errors in your code are detected and handled.

+p
Disallows all anachronistic constructs.
+Mn
Cause migration warnings to be emitted.
-w
Suppresses all compiler warning messages.
+w
Warns about all questionable constructs.
+Wargs
Selectively suppress compiler warnings.
+wn
Specifies the level of the warnings messages.
+Weargs
Selectively interpret warnings or future errors as errors.
+Wwargs
Selectively treats compiler warnings as warning.

+p Command Line Option Syntax

+p

Description:

Disallows all anachronistic constructs.

Ordinarily, the compiler gives warnings about anachronistic constructs. Using the +p option, the compiler gives errors for anachronistic constructs.

Example:

aCC +p file.C
Compiles file.C and gives errors for all anachronistic constructs rather than just giving warnings.

+Mn Command Line Option Syntax

+Mn

Description:

Cause migration warnings to be emitted. Defined values for n are: Note:This option is supported in legacy HP C only.

-w Command Line Option Syntax

-w

Description:

Suppresses all warning messages.

By default, compiler reports all errors and warnings.

Example:

aCC -w file.C
Compiles file.C and reports errors but does not report any warnings.

+w Command Line Option Syntax

+w

Description:

Warns about all questionable constructs, as well as constructs that are almost certainly problems.

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.

Example:

aCC +w file.C
Compiles file.C and warns about both questionable constructs and constructs almost certainly problematic.

Note:This option is equivalent to +w1 option of legacy HP C.

+wn Command Line Option Syntax

+wn

Description:

Specifies the level of the warnings messages.

Usage:

+w{1|2|3}
The value of n can be one of the following:
      1 - All warnings are issued. This includes low level 
          warnings that may not indicate anything wrong with 
          the program. 

      2 - Only warnings indicating that code generation might 
          be affected are issued. This is equivalent to the 
          compiler default without the -w options. 

      3 - No warnings are issued. This is equivalent to the -w 
          option. This option is the same as -W c,-wn.

+Wargs Command Line Option Syntax

+Warg1[,arg2,..argn]

Description

Selectively suppresses any specified warning messages, where arg1 through argn are valid compiler warning message numbers.

Example:

aCC +W600 app.C

+Weargs Command Line Option Syntax

+Wearg1[,arg2,..argn]

Description

Selectively interpret any specified warning or future error messages as errors. arg1 through argn are valid compiler warning message numbers.

Example:

aCC +We 600,829 app.C

+Wwargs Command Line Option Syntax

+Wwarg1[,arg2,..argn]

Description

Selectively treats compiler warnings as warning. arg1 through argn are valid compiler message numbers. Conflicts between +W, +Ww and +We are resolved based on their severity. +We is the highest and +W is the lowest.


Exception Handling Option

By default, exception handling is in effect. To turn off exception handling, you must use the following option.

+noeh Command Line Option Syntax

+noeh

Description:

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" generate an error.

Code compiled with and without +noeh can have undesired results.

Example:

aCC +noeh progex.C
Compiles and links progex.C, which does not use exception handling.

For More Information:

Note:This option is supported in C++ only and silently ignored in C++ C-mode.


Extensions to the Language

These options supports extensions to the C++ language.
-ext
Enable HP value added features.
+e
Enable HP value added features.

-ext Command Line Option Syntax

-ext

Description:

When you specify -ext, you are enabling the following HP aC++ extensions to the C++ standard:

HP aC++ Extentions
Enable 64-bit integer data type support for:
  • long long (signed 64-bit integer)
  • unsigned long long (unsigned 64-bit integer)

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.

Example:

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;
}
Note:This option is synonym to +e option.

+e Command Line Option Syntax

-ext

Description:

This option is synonym to -ext.


Floating Point Processing

+f
Inhibit the automatic promotion of float to double when evaluating expressions.
+O[no]aggressive
Optimizations that may change the behavior of code.
+O[no]cxlimitedrange
Enables[disables] the use of floating point math in the compilation unit.
+O[no]fenvaccess
Access [do not access] the floating point environment.
+O[no]fltacc
Disable [enable] all optimizations that cause imprecise floating-point results.
+O[no]libmerrno
Enable/disable support for errno in libm functions.
+O[no]moveflops
Move [do not move] conditional floating-point instructions out of loops.
-fpeval
Specify minimum precision for expression evaluation.
-[no]fpwidetypes
Enables extended and quad data types.
+FP
Enables trapping behaviors.
+r
Inhibit the automatic promotion of float to double.

+f Command Line Option Syntax

+f

Description:

Inhibit the automatic promotion of float to double when evaluating expressions. This differs from the +r option in that both parameters and function return values are still promoted to double. In ANSI mode, this option is ignored and a warning is issued.

Note:This option is supported in legacy HP C only.

+O[no]cxlimitedrange Command Line Option Syntax

+O[no]cxlimitedrange

Description:

Enables[disables] the specific block of codes with limited range mathematical behavior. This option is equivalent to adding #pragma STDC CX_LIMITED_RANGE at the beginning of each source file submitted for compilation, except that it applies to a compilation unit as opposed to a declaration or a statement. The default is +Onocxlimitedrange.

Note:This option is ignored in C++, which do not support complex data types.

+O[no]fenvaccess Command Line Option Syntax

+O[no]fenvaccess

Description

This option provides a means to inform the compiler when a program might access the floating point environment to test flags or run under non-default modes. Use of the option +Onofenvaccess allows certain optimizations that could subvert flag tests and mode changes such as global common subexpression elimination, code motion, and constant folding. This option is equivalent to adding #pragma STDC FENV_ACCESS ON at the beginning of each source file submitted for compilation. The default is +Onofenvaccess .

-fpeval Command Line Option Syntax

-fpeval=precision

Description:

Specifies the minimum precision to use for floating point expression evaluation. This option does not effect the precision of parameters, return types, or assignments. The default is -fpeval=float.

Usage:

-fpeval=precision

The defined values for precision are:

       float
              Evaluates floating point expressions and 
              constants in their semantic type.
       
       double
              Evaluates float operations and constants
              using the range and precision of double,
              and evaluates all other floating point
              expressions and constants in their 
              semantic type.

       extended
              Utilizes hardware support of these floating
              point registers for optium speed in
              floating point computations. Evaluates
              float and double constants and expressions
              using the range and precision of the extended
              type, and evaluates all other floating point
              expressions in their semantic type. This option
              while providing greater precision than double,
              does not provide greater speed than double
              or float.

-[no]fpwidetypes Command Line Option Syntax

-[no]fpwidetypes

Description:

Enables [disables] extended and quad floating point data types. Quad is a synonym for long double. This option also enables __float80 prototypes. The compiler defines _FPWIDETYPES when -fpwidetypes is in effect. The default is -nofpwidetypes.

+FP Command Line Option Syntax

+FP[flags]

Description:

Specifies how the runtime environment for floating point operations should be initialized at program startup and used at link time. The default is that all trapping behaviors are disabled.

The following flags are supported. Upper case enables the flag, lower case disables the flag.

V (v)     Trap on invalid floating-point operations

Z (z)     Trap on divide by zero

O (o)     Trap on floating-point overflow

U (u)     Trap on floating-point underflow

I (i)     Trap on floating-point operations that produce inexact results.

D (d)     Enable sudden underflow (flush to zero) of denormalized values.
To dynamically change these settings at run-time, see fesetenv(3M).

+O[no]libmerrno Command Line Option Syntax

+O[no]libmerrno

Description

Enables[disables] support for errno in libm functions. The default is +Onolibmerrno.
In C++ C-mode, the default is +Olibmerrno with -Aa option.

+r Command Line Option Syntax

+r

Description:

Inhibit the automatic promotion of float to double when evaluating expressions and passing arguments. This option is ignored and a warning produced if the ANSI mode is in effect.

Note:This option is supported in legacy HP C only.


Header File Options

-Idirectory
Add directory to the directories to be searched for #include files.
-I-
Override the default -Idirectory search-path.
+m[d]
Output quote enclosed (" ") make(1) dependency files to stdout or to a .d file.
+M[d]
Output both quote enclosed and angle bracket enclosed (< >) make(1) dependency files to stdout or to a .d file.

For More Information:

-Idirectory Command Line Option Syntax

-I directory

directory is the HP-UX directory where the compiler looks for header files.

Description:

During the compile phase, adds directory to the directories to be searched for #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:

  1. The directory of the source file containing the #include.
  2. The directory named in the -I option.
  3. The standard include directories /opt/aCC/include and /usr/include.

For #include files that are enclosed in angle brackets (< >), the preprocessor searches in the following order:

  1. The directory named in the -I option.
  2. The standard include directories /opt/aCC/include and /usr/include.

    (The current directory is not searched when angle brackets (< >) are used with #include.)

Example:

aCC -I include file.C
This example directs the compiler to search in the directory include 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.

Description:

The -I- option allows you to override the default -Idirectory search-path. This feature is called view-pathing.

Specifying -I- serves a dual purpose, as follows:

The standard aCC include directories (/usr/include and /opt/aCC/include*) are always searched last for both types of include files.

Usage:

View-pathing can be particularly valuable for medium to large sized projects. For example, imagine that a project comprises two sets of directories. One set contains development versions of some of the headers that the programmer currently modifies. A mirror set contains the official sources.

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.

Examples:

With view-pathing off, the following example obtains all quoted include files from dir1 only if they are not found in the directory of a.C and from dir2 only if they are not found in dir1. Finally, if necessary, the standard include directories are searched. Angle-bracketed includes are searched for in dir1, then dir2, followed by the standard include directories.
aCC -Idir1 -Idir2 -c a.C
With 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.C
CAUTION: 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.C
If 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.


Online Help Option Syntax

+help Command Line Option Syntax

+help

Description:

Invokes the initial menu window of this HP aC++ Online Programmer's Guide.

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 used. If the display variable is not set, a message so indicates. Set your $DISPLAY variable as follows:

export DISPLAY=YourDisplayAddress      (ksh/sh shell notation)

setenv DISPLAY YourDisplayAddress      (csh shell notation)

Examples:

To use a browser other than the default, first set the BROWSER environment variable to the alternate browser's location:
export BROWSER=AlternateBrowserLocation
To invoke the online guide:
aCC +help


Inlining Options

These options allow you to specify the amount of source code inlining done by the HP aC++ compiler.

+d
Disables all inlining of functions.
+inline_level [i]num
Controls how C++ inlining hints influence HP aC++.

See Also:

+inline_level [i]num Command Line Option Syntax

+inline_level [i]num

Description

This option controls how C++ inlining hints influence HP aC++. Such inlining happens in addition to functions explicitly tagged with the inline keyword. By default, this option is off.

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 +Olevel as shown in the following table:

level num
0 1
1 1
2 2
3 2
4 2

If i is also specified, then implicit inlining is invoked for "small" functions without the inline keyword.

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).

Example:

aCC +inline_level3 app.C

See Also:

Note:This option is supported in C++ only.


Library Options

Library options allow you to create, use, and manipulate libraries.
+A
Causes the linker to link with archive libraries.
-AA
Enable use of Rogue Wave Standard C++ Library 2.2.1 and set all standards related options on.
-b
Create a shared library.
-dynamic
Specify dynamically bound executables.
-exec
Create an executable file from an object file.
-lname
Specify a library for the linker to search.
-Ldirectory
Specify a directory for the linker to search for libraries.
-minshared
Indicate an executable makes minimal use of shared libraries.
+nostl
Suppress searching of default -I and -L directory paths and some -l libraries.
-Wx,args
One use of -W is to specify linking of shared or archive libraries.

See Also:

+A Command Line Option Syntax

+A

Description:

Causes the linker to link with archive libraries rather than shared libraries and creates a completely archived executable.

Example:

aCC +A file.o -lm
Links file.o and links in the archived version of the math library, /lib/libm.a, rather than the shared version, /lib/libm.so, and does not link in /usr/lib/hpux32/libdld.so.

See Also:

Note:This option is supported in legacy HP C only.

-b Command Line Option Syntax

-b

Description:

Creates a shared library rather than an executable file.

Example:

aCC -b utils.o -o utils.so
Links utils.o and creates the shared library utils.so.

For More Information:

For more information on shared libraries, see Creating and Using Shared Libraries, and the HP-UX Online Linker and Libraries User's Guide.

-dynamic Command Line Option Syntax

-dynamic

Description:

Produces dynamically bound executables. See -minshared for partially statically bound executables. The default is -dynamic.

-exec Command Line Option Syntax

-exec

Description:

Indicates that any object files created will be used to create an executable file. Constants with a protected or hidden export class are placed in the read-only data section. This option also implies -Bprotected_def. It makes all defined functions and data (even tentatively defined data) protected by default (unless otherwise specified by another binding option or pragma).

-lname Command Line Option Syntax

-lname
The name parameter forms part of the name of a library the linker searches for when looking for routines called by your program.

Description:

Causes the linker to search one of the following default libraries, if they exist, in an attempt to resolve unresolved external references: Whether it searches the shared library (.so) or the archive library (.a) depends on the value of the -a linker option or the -minshared 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.)

Example:

aCC file.o -lnumeric

This example directs the linker to link file.o and (by default) search the library /usr/lib/hpux32/libnumeric.so.

See Also:

-L directory Command Line Option Syntax

-L directory
The directory parameter is the HP-UX directory where you want the linker to search for libraries your program uses before searching the default directories.

Description:

Causes the linker to search for libraries in directory in addition to using the default search path.

See the -l option for default search path.

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.

Example:

aCC -L/project/libs prog.C -lmylib1 -lmylib2

Compiles and links prog.C and directs the linker to search the directories and /project/libs for any libraries that prog.C uses (in this case, mylib1 and mylib2).

See Also:

-minshared Command Line Option Syntax

-minshared

Description:

Indicates that the result of the current compilation is going into an executable file that will make minimal use of shared libraries. This option is equivalent to -exec -Bprotected.

+nostl Command Line Option Syntax

+nostl

Description:

By eliminating references to the standard header files and libraries bundled with HP aC++, this option allows experienced users full control over the header files and libraries used in compilation and linking of their applications, without potential complications that arise in mixing different libraries.

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.

For More Information:

For more information on shared libraries, see the tutorial Creating and Using Shared Libraries and the HP-UX Online Linker and Libraries User's Guide.


Linker Options

You can specify the following linker options on the compiler command line:

-n
The linker marks the output as sharable.
-N
The linker marks the output as unsharable.
-q
The linker marks the output as demand-loadable.
-Q
The linker marks the output as not demand-loadable.
-r
Retains relocation information for subsequent re-linking.
-s
The linker strips the symbol table from the executable file it produces.
-usymbol
Symbol as an undefined symbol in ld's symbol table
-z
The linker disallows dereferencing of null pointers at run time.
+ild
Specifies incremental linking.
+ildrelink
Performs an initial incremental link.

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

Description:

Causes the program file produced by the linker to be marked as sharable.

For More Information:

For details and system defaults, 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.)

See Also:

See also the -N option.

-N Command Line Option Syntax

-N

Description:

Causes the program file produced by the linker to be marked as unsharable.

Unsharable executable files generated with the -N option cannot be executed with exec.

For More Information:

For details and system defaults, refer to the 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.)

See Also:

-q Command Line Option Syntax

-q

Description:

Causes the output file from the linker to be marked as demand-loadable.

For More Information:

For details and system defaults, see 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.)

-Q Command Line Option Syntax

-Q

Description:

Causes the program file from the linker to be marked as not demand-loadable.

For More Information:

For details and system defaults, see 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.)

-r Command Line Option Syntax

-r

Description:

Retain relocation information in the output file for subsequent re-linking.

-s Command Line Option Syntax

-s

Description:

Causes the executable program file created by the linker to be stripped of symbol table information.

Specifying this option prevents using a symbolic debugger on the resulting program.

For More Information:

For more 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.)

-u Command Line Option Syntax

-usymbol

Description:

Enter symbol as an undefined symbol in ld's symbol table. The resulting unresolved reference is useful for linking a program solely from object files in a library. More than one symbol can be specified, but each must be preceded by -u. See ld(1) manpage for more information.

+ild Command Line Option Syntax

+ild

Description:

This option specifies incremental linking. If the output file does not exist, or if it was created without the +ild option, the linker performs an initial incremental link. The output file produced is suitable for subsequent incremental links. The incremental link option is valid for both executable and shared library links. It is not valid for relocatable links, options or tools that strip the output module, and certain optimization options.

For More Information:

See ld(1) manpage for more information and HP-UX Online Linker and Libraries User's Guide

+ildrelink Command Line Option Syntax

+ildrelink

Description:

This option performs an initial incremental link, regardless of the output load module. In certain situations during incremental linking (for example, internal padding space is exhausted), the incremental linker is forced to perform an initial incremental link. The +ildrelink option allows you to avoid such unexpected initial incremental links by periodically rebuilding the output file.

For More Information:

See ld(1) manpage for more information and HP-UX Online Linker and Libraries User's Guide


Options for Naming the Output File

These options allow you to name the compilation output file something other than the default name.

-eepsym
Sets the default entry point address for the output file.
-o outfile
Specifies the name of the output file from the compilation.
-.suffix
Specifies a file name suffix to be used for the output file from the compilation.

-eepsym Command Line Option Syntax

-eepsym

Description:

Sets the default entry point address for the output file to be the same as the symbol epsym. This option only applies to executable files. It does not work if epsym=xec.

-o Command Line Option Syntax

-o outfile
The outfile parameter is the name of the file containing the output of the compilation.

Description:

Causes the output of the compilation to be placed in outfile.

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

-.suffix
The 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.

Description:

Causes HP compiler to direct output from the -E option into a file with the corresponding .suffix instead of into a corresponding .c file.

Example:

aCC -E -.i prog.C
Preprocesses the code in prog.C and puts the resulting code in the file prog.i.


Option to Enable Native Language Support

-Y Command Line Option Syntax

-Y

Description:

Enables Native Language Support (NLS) of 8-bit, 16-bit and 4-byte EUC characters in comments, string literals, and character constants.

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.

For More Information:

Refer to hpnls, lang, and environ in the HP-UX Reference Manual for a description of the NLS model.


Option for Handling Null Pointers

These options allows dereferencing of null pointers.

-z
Allows dereferencing of null pointers at run time.
-Z
Allows dereferencing of null pointers at run time.

-z Command Line Option Syntax

-z

Description:

This ld(1) option disallows dereferencing of null pointers at run time.

Fatal errors result if null pointers are dereferenced. If you attempt to dereference a null pointer, a SIGSEGV error occurs at run time.

Example:

aCC -z file.C
Compiles file.C and generates code to disallow dereferencing of null pointers.

For More Information:

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.)

-Z Command Line Option Syntax

-Z

Description:

Allow dereferencing of null pointers at run time. This is the default. The value of a dereferenced null pointer is zero.


Options for Optimizing Your Code

Optimization options can be used to improve the execution speed of programs compiled with the HP compiler.

To use optimization, first specify the appropriate basic optimization level (+O1, +O2, +O3, or +O4) on the 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.

For More Information:

Basic Optimization Level Options

These options allow you specify the basic level of optimization.
-O
Specify level 2 optimization.
+O0
Specify level 0 optimization.
+O1
Specify level 1 optimization.
+O2
Specify level 2 optimization.
+O3
Specify level 3 optimization.
+O4
Specify level 4 optimization.

-O Command Line Option Syntax

-O

Description:

Invokes the optimizer to perform level 2 optimization. This option is equivalent to +O2 option.

Example:

aCC -O prog.C
Compiles prog.C and optimizes at level 2.

For More Information:

You can set other optimization levels by using the following options:

See Also:

+O0 Command Line Option Syntax

+O0

Description:

Use +O0 for fastest compile time or with simple programs. No optimizations are performed.

Example:

aCC +O0 prog.C
Compiles prog.C and optimizes at level 0.

For More Information:

You can set other optimization levels by using the following options:

See Also:

+O1 Command Line Option Syntax

+O1

Description:

Performs level 1 optimization only. This includes branch optimization, dead code elimination, faster register allocation, instruction scheduling, and peephole optimization. This is the default optimization level.

Example:

aCC +O1 prog.C
Compiles prog.C and optimizes at level 1.

For More Information:

You can set other optimization levels by using the following options:

See Also:

+O2 Command Line Option Syntax

+O2

Description:

Performs level 2 optimization. This includes level 1 optimizations plus optimizations performed over entire functions in a single file.

Example:

aCC +O2 prog.C
Compiles prog.C and optimizes at level 2.

For More Information:

You can set other optimization levels by using the following options:

See Also:

+O3 Command Line Option Syntax

+O3

Description:

Performs level 3 optimization. This includes level 2 optimizations plus full optimization across all subprograms within a single file.

Example:

aCC +O3 prog.C
Compiles prog.C and optimizes at level 3.

For More Information:

You can set other optimization levels by using the following options:

See Also:

+O4 Command Line Option Syntax

+O4

Description:

Performs level 4 optimization. This includes level 3 optimizations plus full optimizations across the entire application program. In the absence of +Oprofile=use, the compiler will emit a warning and the optimization level will drop to +O3. Also the defaults which depend on optimization will be the defaults for +O3.

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 +O4 optimization, there are several things you can do:

  1. Compile at +O4 only those modules that need to be compiled at optimization level 4, and compile the remaining modules at a lower level.

  2. If you still run out of memory, increase the per-process data size limit. Run the System Administrator Manager (SAM) to increase the 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.

  3. If increasing the per-process data size limit does not solve the problem, increase the system swap space. Refer to the System Administration Tasks manual, Chapter 6, "Managing Swap Space." Pay particular attention to the section "Adding File System Swap", because adding file system swap is easier than increasing the amount of device swap, which requires re-configuring your disk. However, if you find that you are consistently compiling beyond the available amount of device swap, you may not have a choice.

    For a complete discussion of swap space, refer to How HP-UX Works: Concepts for the System Administrator.

Object Files Generated at Optimization Level 4

Object files generated by the compiler at optimization level 4, called intermediate object files, are intended to be temporary files. These object files contain an intermediate representation of the user code in a format that is designed for advanced optimizations. Therefore, Hewlett-Packard reserves the right to change the format of these files without prior notice. There is no guarantee that intermediate object files will be compatible from one revision of the compiler to the next. The compiler will issue an error message and terminate when an incompatible intermediate file is generated.

Example:

aCC +O4 prog.C
Compiles prog.C and optimizes at level 4.

For More Information:

You can set other optimization levels by using the following options:

See Also:

Additional Optimizations for Finer Control

+ES[no]lit
Place string literals into read-only memory.
+O[no]clone
Causes cloning of functions.
+O[no]failsafe
Enable [disable] failsafe optimization.
-fast
Selects options for optimum execution speed.
+Ofast
Selects optimization options for optimum execution speed.
+Ofaster
Optimizes execution speed at build time.
+[no]nrv
Performs the named return value optimization.
+O[no]all
Perform maximum optimization.
+O[no]aggressive
Optimizations that may change the behavior of code.
+O[no]conservative
Optimize with the minimum risk of side effects.
+O[no]limit
Optimize using [un]restricted compile time.
+O[no]ptrs_ansi
Supports [do not support] ANSI type pointers aliasing
+O[no]ptrs_strongly_typed
Use [do not use] when pointers are type-safe.
+O[no]ptrs_to_globals
Tells the optimizer whether global variables are modified through pointers
+O[no]size
Enable [disable] code expanding optimizations.

+ES[no]lit Command Line Option Syntax

+ES[no]lit

Note: This option is deprecated and may not be supported in future releases. Instead you can use +Olit=all for +ESlit and +Olit=none for +ESnolit option.

Description:

Places[do not place] string literals and const-qualified variables that do not require load-time or run-time initialization in the read-only data section. This is same as using +Olit option.

+O[no]clone Command Line Option Syntax

+O[no]clone

Description:

Cloning is controlled by a list-free option +O[no]clone analogous to +O[no]inline. It will be on by default with +O3 and +O4, but can be disabled.

+O[no]clone influences cloning both in to and out of the functions it governs.

Example:

  $ cc -c +P +O4 foo.c +Onoclone
  $ cc -c +P +O4 bar.c
in the above example, +Onoclone applies to the function foo, and directs that foo itself should not be cloned and that calls from foo (bar) should not be redirected to clones.

+O[no]failsafe Command Line Option Syntax

+O[no]failsafe

Description:

Enables[disables] failsafe optimization. When a compilation fails at the current optimization level +Ofailsafe will automatically restart the compilation at +O2 (for specific high level optimizer errors +O3/+O4) or +O0. The default is +Onofailsafe.

+[no]nrv Command Line Option Syntax

-Wc,-nrv_optimization,[off|on]
or
+[no]nrv

Description:

The above syntax disables or enables the named return value (NRV) optimization. By default it is disabled.

The NRV optimization eliminates a copy-constructor call by allocating a local object of a function directly in the caller's context if that object is always returned by the function. For example:

        struct A{
        A(A const&); //copy-constructor
        }; 

        A f(A constA x) {
           A a(x);
           return a; // Will not call the copy constructor if the
        }            // optimization is enabled.

This optimization will not be performed if the copy-constructor was not declared by the programmer. Note that although this optimization is allowed by the ISO/ANSI C++ standard, it may have noticeable side-effects.

Example:

aCC -Wc,-nrv_optimization,on app.C

+O[no]all Command Line Option Syntax

+O[no]all

Note:This option is deprecated and may not be supported in future releases. Instead you can use +Ofaster. +O4 +Onolimit +Oaggressive is approximately equivalent to +Oall.

Description:

Use +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.

+O[no]aggressive Command Line Option Syntax

+O[no]aggressive

Note:This option is deprecated and may not be supported in future releases. Instead you can use +Ofast option.

Description:

The +Oaggressive option enables aggressive optimizations. The +Onoaggressive option disables aggressive optimizations.

By default, aggressive optimizations are turned off. The +Oaggressive option is approximately equivalent to +Osignedpointers +Olibcalls +Onoinitcheck +Ofltacc=relaxed.

+O[no]conservative Command Line Option Syntax

+O[no]conservative

Note:This option is deprecated and may not be used in future releases.

Description:

This option is approximately equivalent to +Oparmsoverlap +Onomoveflops.

The default is +Onoconservative.

+O[no]limit Command Line Option Syntax

+O[no]limit

Description:

The +Olimit option enables optimizations that significantly increase compile-time or that consume a lot of memory.
The +Onolimit option supresses optimizations regardless of their effect on compile time or memory consumption.
Use +Onolimit at all optimization levels.

Usage:

+O[no]limit=level
The defined values of level are:
    default
           Based on tuning heuristics, the optimizer
           will spend a reasonable amount of time
           processing large procedures. This is the
           default option.

    min
           For large procedures, the optimizer will 
           avoid non-linear time optimizations.
           This option is a synonym for +Olimit.

    none 
           The optimizer will fully optimize large
           procedures, possibly resulting in 
           significantly increased compile-time.
           This option is a synonym for +Onolimit.

Example:

To remove optimization time restrictions at the second, third, or fourth optimization levels, use +Onolimit as follows:
aCC <opt level> +Onolimit sourcefile.C

+O[no]ptrs_ansi Command Line Option Syntax

+O[no]ptrs_ansi

Description:

The default is +Onoptrs_ansi
+Optrs_ansi is synonomous to +Otype_safety=ansi.
+Onoptrs_ansi is synonomous to +Otype_safety=off.

Note:This option is supported in legacy HP C and C++ C-mode only. A warning is displayed in C++, when this option is used.

+O[no]ptrs_strongly_typed Command Line Option Syntax

+O[no]ptrs_strongly_typed

Description:

The default is +Onoptrs_strongly_typed.
+Optrs_strongly_typed is synonomous to +Otype_safety=strong.
+Onoptrs_strongly_typed is synonomous to +Otype_safety=off.

Note:This option is supported in legacy HP C and C++ C-mode only. A warning is displayed in C++, when this option is used.

+O[no]ptrs_to_globals Command Line Option Syntax

+O[no]ptrs_to_globals

Description:

This option tells the optimizer whether global variables are accessed [are not accessed] through pointers. The default is +Onoptrs_to_globals.

Note:This option is supported for no-list form in HP C and in C++ C-mode. A warning is displayed in C++, when this option is used and the list form is deferred.

+O[no]size Command Line Option Syntax

+O[no]size

Description:

While most optimizations reduce code size, the +Osize option suppresses those few optimizations that significantly increase code size. The +Onosize option enables code-expanding optimizations.

Use +Osize at all optimization levels. The default is +Onosize.

Advanced +Ooptimization Options

Advanced optimization options provide additional control for special situations.

+O[no]cross_region_addressing
Enable [disable] cross region addressing.
+O[no]dataprefetch
Enable [disable] optimizations to generate data prefetch instructions for data structures referenced within innermost loops.
+O[no]extern
Perform [do not perform] optimization for a specified set of symbols.
+O[no]fltacc
Disable [enable] all optimizations that cause imprecise floating-point results.
+Ofrequently_called
Identify functions that are frequently called.
+O[no]initcheck
Enable [disable] initialization of uninitialized scalar variables to null values.
+O[no]inline
Inline [do not inline] procedure calls.
+Oinlinebudget
Inline aggressively.
+Olit
Places string literals and const-qualified variables in the read-only data section.
+Ointeger_overflow
Controls integer overflow assumptions made by the compiler.
+Olevel=name1[,name2,...nameN]
Lower the optimization level for one or more named functions.
+O[no]libcalls
Use [do not use] millicode routines instead of certain math library calls.
+O[no]loop_block
Enable [disable] blocking of eligible loops for improved cache performance.
+O[no]looptransform
Transform [do not transform] eligible loops for improved cache performance.
+O[no]loop_unroll_jam
Enable [disable] loop unrolling and jamming.
+O[no]moveflops
Move [do not move] conditional floating-point instructions out of loops.
+O[no]openmp
Enable [disable] OpenMP directives.
+optsfilename
The options are processed as if they were specified on the command line.
+O[no]parminit
Enable [disable] automatic initialization of unspecified function parameters
+O[no]parmsoverlap
Optimize with the assumption that subprogram arguments do [do not] refer to the same memory.
+O[no]procelim
Enable [disable] elimination of unreferenced procedures.
+O[no]promote_indirect_calls
Enable [disable] the promotion of indirect calls to direct calls.
+Orarely_called
Identify functions that are rarely called.
+O[no]recovery
Generate recovery code for control speculation.
+O[no]signedpointers
Optimize treating pointers as signed [unsigned] quantities.
+Oshortdata[=size]
Place objects in shortdata area.
+O[no]store_ordering
Preserve original program order for stores.
+Otype_safety
Enables [disables] aliasing across types.
+Ounroll_factor=n
Applies the unroll factor to the current block.
+O[no]volatile
Assume all global variables are [not] volatile.
+O[no]whole_program_mode
Enables[disables] the assertion for the files compiled with this option.

+O[no]cross_region_addressing Command Line Option Syntax

+O[no]cross_region_addressing

Description:

Enables [disables] the use of cross-region addressing. Cross-region addressing is required if a pointer, such as an array base, points to a different region than the data being addressed due to an offset that results in a cross-over into another region. Standard conforming applications do not require the use of cross-region addressing. The default is +Onocross_region_addressing.

Note:Using this option may result in reduced runtime performance.

+O[no]dataprefetch Command Line Option Syntax

+O[no]dataprefetch

Description:

When +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).

Use this option for applications that have high data cache miss overhead.

The default is +Onodataprefetch.
+Odataprefetch is a synonym for +Odataprefetch=indirect.
+Onodataprefetch is a synonym for +Odataprefetch=none.

Usage:

+Odataprefetch=kind
The defined values for kind are:
     direct
           Enable generation of data prefetch instructions
           for the benefit of direct memory accesses, but
           not indirect memory accesses.

     indirect
           Enables the generation of data prefetch instructions
           for the benefit of both direct and indirect memory
           accesses.  This is the default at optimization
           levels +O2 and above.

     none
           Disables the generation of data prefetch instructions.
           This is the default at optimization levels +O1
           and below.

+O[no]extern Command Line Option Syntax

+O[no]extern

Note:This option is deprecated and may not be supported in the future releases.

Description:

Use +O[no]extern at optimization levels 0, 1, 2, 3, or 4. The default is +Oextern with no name list.

+Oextern is synonym for -Bextern
+Onoextern is synonym for -Bprotected

+O[no]fltacc Command Line Option Syntax

+O[no]fltacc=level

Description:

This option disables [enables] floating-point optimizations that can result in numerical differences. Any option other than +Ofltacc=strict also generates Fused Multiply-Add (FMA) instructions. FMA instructions can improve performance of floating-point applications.

If you specify neither +Ofltacc nor +Onofltacc, less optimization is performed than for +Onofltacc. If you specify neither option, the optimizer generates FMA instructions but does not perform any expression-reordering optimizations.

Specifying +Ofltacc insures the same result as in unoptimized code (+O0).

Usage:

+Ofltacc=level
The defined values for level are:
    default
          Allows contractions, such as fused multiply-
          add(FMA), but disallows any other floating
          point optimization that can result in numerical
          differences.

    limited
          Like default, but also allows floating point
          optimizations which may affect the generation
          and propagation of infinities, NaNs, and the
          sign of zero.

    relaxed
          In addition to the optimizations allowed by
          limited, permits optimizations, such as 
          reordering of expressions, even if parenthesized,
          that may affect rounding error. This is the same 
          as +Onofltacc.

    strict
          Disallows any floating point optimization
          that can result in numerical differences. This
          is the same as +Ofltacc.
All options except +Ofltacc=strict 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 with these options 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, these options may be unsatisfactory. To insure the same result as in unoptimized code, use +Ofltacc.

Example:

Options except +Ofltacc=strict allows the compiler to replace a 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.

+Ofrequently_called Command Line Option Syntax

+Ofrequently_called=function1[,function2...]

Description:

The named functions are assumed to be frequently called. This option overrides any information in a profile database.
+Ofrequently_called:filename

Description:

The file indicated by filename contains a list of functions, separated by spaces or newlines. These functions are assumed to be frequently called. This option overrides any information in a profile database.

+O[no]initcheck Command Line Option Syntax

+O[no]initcheck

Description:

The initialization checking feature of the optimizer has three possible states: on, off, or unspecified.

Use +Oinitcheck at optimization level 2 or above.

+O[no]inline Command Line Option Syntax

+O[no]inline

Description:

The +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 +Oinline at optimization levels 3 and 4.

Usage:

+O[no]inline=function1{,function2...]
Enables [disables] optimizer inlining for the named functions.
+O[no]inline:filename
The file indicated by filename should contain a list of function names, separated by commas or newlines. Optimization is enabled [disabled] for the named functions.

See Also:

+Oinlinebudget Command Line Option Syntax

+Oinlinebudget=n

Description:

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:

= 100
Default level of inlining.

> 100
More aggressive inlining. The optimizer is less restricted by compilation time and code size when searching for eligible routines to inline.

2 - 99
Less aggressive inlining. The optimizer gives more weight to compilation time and code size when determining whether to inline.

= 1
Only inline if it reduces code size.

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.

For More Information:

See also the +O[no]inline option.

+Olit Command Line Option Syntax

+Olit=kind

Description:

This option places the data items that do not require load-time or run-time initialization in a read-only data section. +Olit=all is the default in aCC and +Olit=const is the default in C.

Usage:

+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. 

    const
          All string literals appearing in a context
          where const char * is legal, 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=const
          is mapped to +Olit=all with a warning except in
          C mode. +Olit=const replaces the deprecated
          +ESconstlit option in C. 

    none
          No constants are placed in a read-only data
          section. +Olit=none replaces the deprecated 
          +ESnolit option.

+Ointeger_overflow Command Line Option Syntax

+Ointeger_overflow=[aggressive|conservative]

Description:

To provide the best runtime performance, the compiler makes assumptions that runtime integer arithmetic expressions that arise in certain contexts do not overflow (produce values that are too high or too low to represent) both expressions that are present in user code and expressions that the compiler constructs itself. Note that if an integer arithmetic overflow assumption is violated, runtime behavior is undefined.

Usage:

+Ointeger_overflow=kind
The defined values of kind are:
   aggressive    allows the compiler to make a broad set of 
                 assumptions that integer arithmetic expressions
                 do not overflow.

   conservative  directs the compiler to make fewer assumptions
                 that integer arithmetic expressions do not
                 overflow.   

+Olevel=name1[,name2,...,nameN] Command Line Option Syntax

+Olevel=name1[,name2,...,nameN]

Description:

This option lowers optimization to the specified level for one or more named functions. level can be 0, 1, 2, 3, or 4. The name parameters are names of functions in the module being compiled. Use this option when one or more functions do not optimize well or properly. This option must be used with a basic +Olevel or -O option. Note that 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.

Examples

The following command optimizes all functions at level 3, except for the functions myfunc1 and myfunc2, which it optimizes at level 1.
aCC +O3 +O1=myfunc1,myfunc2 funcs.c main.c
The 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
Note:This option is deprecated and may not be supported in future releases. On IPF, including a system header file will cause the functions declared therein to be eligible for libcalls transformations, regardless of the state of +O[no]libcalls.

Description:

The default is +Onolibcalls. Use +O[no]libcalls at any optimization level.

+O[no]loop_block Command Line Option Syntax

+O[no]loop_block

Description:

The +O[no]loop_block option enables [disables] blocking of eligible loops for improved cache performance.

The default is +Onoloop_block and can be used at optimization level(s) 2, 3, and 4.

For More Information:

Note:This option is supported in legacy HP C only.

+O[no]loop_transform Command Line Option Syntax

+O[no]loop_transform

Description:

The +O[no]loop_transform 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 +Oloop_transform at optimization levels 2, 3 and 4. You cannot use this option at levels 0-1.

For More Information:

Note:This option is supported in legacy HP C only.

+O[no]loop_unroll Command Line Option Syntax

+O[no]loop_unroll[=unroll_factor]

Description:

Enable [disable] loop unrolling. This optimization can occur at optimization levels 2, 3, and 4. The default is +Oloop_unroll. The default is 4, that is, four copies of the loop body. The unroll_factor controls code expansion.

For More Information:

Note:This option is supported in legacy HP C only.

+O[no]loop_unroll_jam Command Line Option Syntax

+O[no]loop_unroll_jam

Description:

The +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 only.

For More Information:

Note:This option is supported in legacy HP C only.

+O[no]moveflops Command Line Option Syntax

+O[no]moveflops
Note: The option is deprecated and may not be supported in future releases.

Description:

The default is +Omoveflops. The +Onomoveflops option is approximately equivalent to +Ofltacc=strict +Ofenvaccess.

+O[no]openmp Command Line Option Syntax

+O[no]openmp

Description:

+Oopenmp option requests the OpenMP directives to be honored. This option is effective at any optimization level. Non OpenMP parallelization directives will be ignored with warnings. +Onoopenmp requests that OpenMP directives be silently ignored. If neither +Oopenmp nor +Onoopenmp is specified, OpenMP directives will be ignored with warnings.

This specification is available at OpenmP.

Because multithreading is involved, +Oopenmp mutomatically implies -mt.

OpenMP programs require the libomp and libcps runtime support libraries to be present on both the compilation and runtime system(s). The compiler driver will automatically include them when linking.

It is recommended that you use the -N option when linking OpenMP programs to avoid exhausting memory when running with large numbers of threads.

In this release of aCC containing OpenMP, some debugging position information for OpenMP constructs may not be accurate. In addition, symbols marked with the "threadprivate" pragma may not be visible to the debugger. To work around this limitation, use the "__thread" storage class specifier in the symbol declaration instead.

   #if defined(__HP_aCC) && !defined(__THREAD)
   #define __THREAD
   #endif

   __THREAD int tprvt;
   #pragma omp threadprivate(tprvt)
along with the following command line, until the bug is fixed:
aCC -D__THREAD=__thread
Example:
   int n = 100;
   #pragma omp for firstprivate(n)
   for (int i = 0; i < n; i++) {
      // Loop executes an indeterminate number of times because
      // private copy of n is not initialized prior to calculation
      // of loop iteration count.
   }

+opts Command Line Option Syntax

+opts filename

Description:

The file indicated by filename contains a list of options that are processed as if they had been specified on the command line at the point of the +opts option.

+O[no]parminit Command Line Option Syntax

+O[no]parminit

Description:

Enables [disables] automatic initialization to non-NaT of unspecified function parameters at call sites. This is useful in preventing NaT values in parameter registers. The default is +Onoparminit.

+O[no]parmsoverlap Command Line Option Syntax

+O[no]parmsoverlap

Description:

The +Onoparmsoverlap option optimizes with the assumption that on entry to a function each of that function's pointer-typed formals points to memory that is accessed only through that formal or through copies of that formal made within the function. For example, that memory must not be accessed through a different formal, and that formal must not point to a global that is accessed by name within the function or any of its callees.

Use +Onoparmsoverlap if C/C++ programs have been literally translated from FORTRAN programs.

The default is +Oparmsoverlap.

+O[no]procelim Command Line Option Syntax

+O[no]procelim

Description:

Enables [disables] the elimination of dead procedure code and sometimes the unreferenced data.

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. Also note that any function having symbolic debug information associated with it is not removed.

The default is +Oprocelim unless -b is used.

+O[no]promote_indirect_calls Command Line Option Syntax

+O[no]promote_indirect_calls

Description:

This option uses profile data from profile-based optimization and other information to determine the most likely target of indirect calls and promotes them to direct calls. Indirect calls occur with pointers to functions and virtual 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.

+Orarely_called Command Line Option Syntax

+Orarely_called=function1[,function2...]

Description:

The named functions are assumed to be rarely called. This option overrides any information in a profile database.
+Orarely_called:filename

Description:

The file indicated by filename contains a list of functions, separated by spaces or newlines. These functions are assumed to be rarely called. This option overrides any information in a profile database.

+O[no]recovery Command Line Option Syntax

+O[no]recovery

Description:

Generate [do not generate] recovery code for control speculation. The default is +Orecovery. For code that writes to uncacheable memory that may not be properly identified as volatile, the +Orecovery option reduces the risk of incorrect behavior.

Note:The program that uses signal handlers to catch signals raised by memory accesses may not behave correctly under +Onorecovery.

+O[no]signedpointers Command Line Option Syntax

+O[no]signedpointers

Description:

The +Osignedpointers option treats pointers in Boolean comparisons (for example, <, <=, >, >=) as signed quantities. Applications that allocate shared memory and that compare a pointer to shared memory with a pointer to private memory may run incorrectly if this optimization is enabled.

The default is +Onosignedpointers.

Note:This option is supported in legacy HP C and C++ C-mode only. A warning is displayed in C++, when this option is used.

+Oshortdata Command Line Option Syntax

+Oshortdata[=size]

Description:

All objects of [size] bytes or smaller are placed in the short data area, and references to such data assume it resides in the short data area. Valid values of size are a decimal number between 8 and 4,194,304 (4MB).
If no size is specified, all data is placed in the short data area. The default is +Oshortdata=8.
NOTE: Using a value that is too big or without the optional size, possibly through +Ofast, may give various linker "fixup" errors, if there is more than 4Mb of short data.

+Ostore_ordering Command Line Option Syntax

+O[no]store_ordering

Description:

Preserve [do not preserve] the original program order for stores to memory that is visible to multiple threads. This does not imply strong ordering. The default is +Onostore_ordering.

+Otype_safety Command Line Option Syntax

+Otype_safety=kind

Description:

Controls type-based aliasing assumptions. The default is +Otype_safety=off

Usage:

+Otype_safety={off|limited|ansi|strong}
The defined values for kind are:
   off 
       The default. Specifies that aliasing can occur freely 
       across types. 

   limited 
       Code follows ANSI aliasing rules. Unnamed objects 
       should be treated as if they had an unknown type. 

   ansi 
       Code follows ANSI aliasing rules. Unnamed objects should 
       be treated the same as named objects. 

   strong 
       Code follows ANSI aliasing rules, except that accesses through 
       lvalues of a character type are not permitted to touch objects 
       of other types and field addresses are not to be taken. 

Note:This option is supported in legacy HP C and C++ C-mode only. A warning is displayed in C++, when this option is used.

+Ounroll_factor Command Line Option Syntax

+Ounroll_factor=n 

Description:

This option applies the unroll factor to all loops in the current translation unit. You can apply a unroll factor, which you think is best for the given loop or apply no unrolling factor to the loop. If this option is not specified, compiler uses its own heuristics to determine the best unroll factor for the inner loop.

A user specified unroll factor will override the default unroll factor applied by the compiler.
Specifying n=1 will prevent the compiler from unrolling the loop.
Specifying n=0 allows the compiler to use its own heuristics to apply the unroll factor.

Note:This option will be ignored if it is placed in a loop other than the innermost loop.

+O[no]volatile Command Line Option Syntax

+O[no]volatile 

Description:

The +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 all optimization levels. The default is +Onovolatile.

Note:This option is supported in legacy HP C only.

+O[no]whole_program_mode Command Line Option Syntax

+O[no]whole_program_mode

Description:

The +Owhole_program_mode option enables the assertion that only the files that are compiled with this option directly reference any global variables and procedures that are defined in these files. In other words, this option asserts that there are no unseen accesses to the globals.

When this assertion is in effect, the optimizer can hold global variables in registers longer and delete inlined or cloned global procedures. This option is in effect only at +O4 level of optimization.

All files compiled with +Owhole_program_mode must also be compiled with +O4. If any of the files were compiled with +O4 but were not compiled with +Owhole_program_mode, the linker disables the assertion for all files in the program.

The default is +Onowhole_program_mode which disables the assertion.

Use this option to increase performance speed, but only when you are certain that only the files compiled with +Owhole_program_mode directly access any globals that are defined in these files.


Profile-Based Optimization Options

Profile-based optimization is a set of performance-improving code transformations based on the run-time characteristics of your application.

+dfname
Specifies the profile database to use with profile-based optimization.
+I
Prepares the object code for profile-based optimization data collection.
+Oprofile
Prepares the object code for profile-based optimization data collection.
+P
Performs profile-based optimization.
+Oreusedir=path
Saves the intermediate object files for reuse.

For More Information:

For more information on performing profile-based optimization, see:

+dfname Command Line Option Syntax

+dfname
Note:This option is deprecated in HP-UX 11i V1.6 IPF release.

Description:

Instead of using +P with +df filename, you can use +Oprofile=use:filename.

+Oprofile Command Line Option Syntax

+Oprofile=[use|collect]

Description:

Instructs the compiler to instrument the object code for collecting run-time profile data. The profiling information can then be used by the linker to perform profile-based optimization.

+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.

Example:

aCC +Oprofile=collect -O -c prog.C
aCC +Oprofile=collect -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 +Oprofile=use.

+I Command Line Option Syntax

+I
Note:This option is deprecated in HP-UX 11i V1.6 IPF release. Instead you can use +Oprofile=collect.

Description:

Instructs the compiler to instrument the object code for collecting run-time profile data. The profiling information can then be used by the linker to perform profile-based optimization. This option is a synonym to +Oprofile=collect .

+P Command Line Option Syntax

+P
Note:This option is deprecated in HP-UX 11i V1.6 IPF release. Instead you can use +Oprofile=use. Instead of using +P with +df filename, you can use +Oprofile=use:filename.

Description:

Directs the compiler to use profile information to guide code generation and profile-based optimization. The compiler generates intermediate compiler code instead of compiled object code. This option is a synonym to +Oprofile=use .

+Oreusedir=path

+Oreusedir=path

Description:

The +Oreusedir option specifies that the intermediate object files produced as a result of +I, +P or +O4 link are either saved in the directory tree at path or are reused from a previous link that used the +Oreusedir option. This can save considerable amount of time on the subsequent links. The default is to use TMPDIR and remove the temporary objects after each link.

Note:This option is supported in legacy HP C only.


Other Options that Affect Optimization

+DS
Perform instruction scheduling tuned for a particular implementation.
+O[no]info
Displays informational messages about the optimization process.

+O[no]info Command Line Option Syntax

+O[no]info

Description:

+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.


Performance

The HP compiler provides a variety of options to help improve build and run-time performance. Choose from the following:

-fast
Select options for optimum execution speed.
+Ofast
Selects optimization options for optimum execution speed.
+Ofaster
Optimizes execution speed at build time.
+inline_level [i]num
Controls how C++ inlining hints influence HP aC++.
Also allows implicit inlining of small functions that are not explicitly tagged with the inline keyword.
+[no]objdebug
Generate debug information in object files and not in the executable.
+DSmodel
Perform instruction scheduling tuned for a particular implementation.
Optimization Options
Select the appropriate options to improve program execution speed.
+[no]srcpos
Controls the generation of source position information.

-fast Command Line Option Syntax

-fast

Description:

The -fast option selects a combination of optimization options for optimum execution speed for reasonable build times. Currently chosen options are: You can override any of the options in -fast by specifying a subsequent option after it. This option is a synonym for +Ofast.

Usage:

This option may aid in porting C++ and C applications compiled on other UNIX operating systems to HP-UX.

Note: Do not use this option for programs that depend on IEEE standard floating-point denormalized numbers. Otherwise, different numerical results may occur.

+Ofast Command Line Option Syntax

+Ofast

Description:

The +Ofast option selects a combination of optimization options for optimum execution speed for reasonable build times. Currently chosen options are: This option is a synonym for -fast.
NOTE: Use +Oshortdata[=size] to limit the amount of short data. The larger the value if N, the more short data.

+Ofaster Command Line Option Syntax

+Ofaster

Description:

This option is a synonym for +Ofast with an increased optimization level. If used with +Oprofile=use, the optimization level will be +O4 else it will drop to +O3. The definition of +Ofaster may change or it may be deprecated in future releases.

+[no]srcpos Command Line Option Syntax

+[no]srcpos

Description:

Controls the generation of source position information for the Caliper and CXperf performance analysis tools. The default is +srcpos. When +srcpos, is in effect, the compiler will generate this information. When +nosrcpos is in effect, the compiler will not generate this information and the compiler will instruct the linker to discard any of this information found in the object files.


Porting

Use the following options as necessary when porting your code from other operating environments to HP-UX.

-fast
Select options for optimum execution speed.
+sb
specify unqualified bitfields to signed.
+ub
specify unqualified bitfields to unsigned.
+uc
Treat an unqualified (plain) char data type as unsigned char.

+sb Command Line Option Syntax

+sb

Description:

Specifies unqualified char/short/int/long/long long bitfields are treated as signed. The default is +sb.

Note:When both +sb and +uc are in effect, +uc will override this for char bit fields.

+ub Command Line Option Syntax

+ub

Description:

Specifies unqualified char/short/int/long/long long bitfields are to be unsigned . Has no effect on signedness of enum bitfields or on signedness of non-bitfield c har. The default is +sb.

+uc Command Line Option Syntax

+uc

Description:

By default, HP compiler treats all unqualified char data types as signed char. Specifying +uc causes an unqualified (plain) char data type to be treated as unsigned char. (Overloading and mangling are unchanged.)

Usage:

Use this option to help in porting applications from environments where an unqualified (plain) char type is treated as unsigned char.

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.


Preprocessor Options

The following options are accepted by the preprocessor:

-C
Prevent the preprocessor from stripping comments.
-Dname
Defines name to the preprocessor.
-E
Runs only the preprocessor and sends output to stdout.
+m[d]
Output quote enclosed (" ") make(1) dependency files to stdout or to a .d file.
+M[d]
Output both quote enclosed and angle bracket enclosed (< >) make(1) dependency files to stdout or to a .d file.
-P
Runs only the preprocessor and sends output to a corresponding .i file.
-.suffix
Sends preprocessed output to the corresponding output file ending with .suffix.
-Uname
Undefines name in the preprocessor.

See Also:

-C Command Line Option Syntax

-C

Description:

Prevent the preprocessor from stripping comments. This option is supported in aCC only if -tp is used. See the description of cpp(1) in the HP-UX Reference Manual or the cpp(1) manpage for details.

Note:This option is supported in legacy HP C only.

-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).

Description:

Defines a symbol name (name) to the preprocessor, as if defined by the preprocessing directive #define.

If no definition (def) is given, the name is defined as "1".

Note:__ia64 and __HP_aCC are defined automatically.

Example:

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
  ...
}

For More Information:

-E Command Line Option Syntax

-E

Description:

Runs only the preprocessor on the named C++ files and sends the result to standard output (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.

Redirecting Output From This Option

Use the -.suffix option to redirect the output of this option.

+m[d] Command Line Option Syntax

+m[d] 

Description:

Directs a list of the quote enclosed (" ") header files upon which your source code depends to stdout. The list is in a format accepted by the make(1) command.

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.

Usage:

Use +m[d] when you also specify the -E or the -P option.

Used with the -E option, only dependency information is generated.

Examples:

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 a.i
aCC -c -P +md a.C -o /tmp/c c.d /tmp directory a.i

+M[d] Command Line Option Syntax

+M[d]

Description:

Directs a list of both the quote enclosed (" ") and angle bracket enclosed (< >) header files upon which your source code depends to stdout. The list is in a format accepted by the make(1) command.

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.

Usage:

Use +Md when you also specify the -E or the -P option.

Used with the -E option, only dependency information is generated.

Examples:

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 a.i
aCC -c -P +Md a.C -o /tmp/c c.d /tmp directory a.i

-P Command Line Option Syntax

-P

Description:

Only preprocesses the files named on the command line without invoking further phases. Leaves the result in corresponding files with the suffix .i.

Example:

aCC -P prog.C
Preprocesses the file prog.C leaving the output in the file prog.i. Does not compile the program.

For More Information:

-Uname Command Line Option Syntax

-Uname
name is the symbol name whose definition is removed from the preprocessor.

Description:

Undefines any name that has initially been defined by the preprocessing stage of compilation.

A name can be a definition set by HP compiler; 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 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.

For More Information:


Profiling Options

HP compilers provides the following options for profiling your code.

-G
Compile-time and link-time option to support gprof.
-p
Compile-time and link-time option to support prof.
+profilebucketsize
Link-time option to support prof and gprof.

See Also:

-G Command Line Option Syntax

-G

Description:

At compile-time, -G produces code that counts the number of times each arc in the call graph is traversed. At link-time, when you are building an executable (but not a shared library) -G picks up profiled versions of certain system libraries and picks up the gprof support library.

Example:

aCC -G file.C
Compiles file.C and creates the executable file a.out instrumented for use with gprof.

For More Information:

Refer to the gprof(1) man page. (If you see the message "Man page could not be formatted," ensure the man page is installed.)

-p Command Line Option Syntax

-p

Description:

At compile-time, -p produces code that counts the number of times each routine is called. At link-time, when you are building an executable (but not a shared library) -p picks up profiled versions of certain system libraries and picks up the prof support library.

Example:

aCC -p file.C
Compiles file.C and creates the executable file a.out instrumented for use with prof.

For More Information:

Refer to the prof(1) man page. (If you see the message "Man page could not be formatted," ensure the man page is installed.)

+profilebucketsize Command Line Option Syntax

+profilebucketsize=[16|32]

Description:

Link-time option to support prof and gprof when building an executable, but not a shared library. When prof or gprof startup code invokes sprofil(2), this option specifies the size in bits of the counters used to record sampled values of the program counter. The effect of this option can be overridden by setting the environment variable LD_PROFILEBUCKET_SIZE when running the instrumented program. This environment variable has no effect when building the instrumented program. Legal values are 16 (the default), and 32. See gprof(1) and ld(1) for more details.


Standards Related Options

The following options related to the ANSI/ISO 9899-1990 Standard for the C Programming Language and ANSI/ISO International Standard and ISO/IEC 14882 Standard for the C++ programming Language are accepted by the compiler.

-Aa
Enable the use of standard options (-Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on).
-AA
Enable Rogue Wave Standard C++ Library 2.2.1 and set all standards related options on.
-Ac
Disables ANSI C compliance
-Ae
Enables ANSI C c89 mode.
-AOa
-AOe
Conforms to the ANSI C standard.
-AP
Turns off -AA mode and uses the older C++ runtime libraries.
+legacy_hpc
Enables old HP C compiler.
-Wc,-ansi_for_scope,[on][off]
Enable or disable the scoping rules for init-declarations in for statements.
-Wc,-koenig_lookup,[on][off]
Enable or disable argument-dependent lookup rules (also known as Koenig lookup).

-Aa Command Line Option Syntax

-Aa

Description:

Instructs the compiler to use Koenig lookup and strict ANSI for scope rules. This option is equivalent to specifying,
-Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on. The default is off. Refer to -Ae option for C++ C-mode description.

Usage:

The standard features enabled by -Aa are incompatible with earlier C and C++ features.

For More Information:

-AA Command Line Option Syntax

-AA

Description:

The new -AA command line option enables use of the new 2.0 Standard C++ Library, which includes the new standard conforming ("templatized") iostream library. This is the first release of the 2.0 library. It conforms to the ISO C++ standard. The default is -AA without -Wc,-ansi_for_scope.

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.

The version of the 2.0 Standard C++ library (libstd_v2) included in this release is incompatible with the previous versions of the same library. Using the -AA option and the new 2.0 library creates a binary incompatibility with any other applications/libraries compiled with the -AA option under the previous version of the aC++ product.

In order to use the new 2.0 library, you must recompile using the -AA option.

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.

The -Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on options are also set.

For More Information:

Note:This option is not supported in legacy HP C. This option is ignored with warnings in C++ C-mode.

-Ac Command Line Option Syntax

-Ac

Description:

For C, requests compatibility mode (K&R). This option is not supported in aC++. See -Ae option for C++ C-mode.

Note:This option is supported in legacy HP C only.

-Ae Command Line Option Syntax

-Ae

Description:

Setting the -Ae option invokes aC++ as an ANSI C compiler, with additional support for HP C language extensions. This means the aC++ compiler will accept c89 compatible C source programs and compile them just like the C compiler. Refer to the HP C compiler documentation for details of the HP C language extensions.

For C++, if -Ae is anywhere on the command line, C-mode will be in effect. -AA and -AP will be ignored with warnings. If both -Ae and -Aa or -Ac are present, C-mode will be in effect and the right most option determines whether extended ANSI (-Ae) or strict ANSI (-Aa) or K&R (-Ac) is in effect. Since K&R is not supported, if it is in effect, the result will be fatal. So, to get strict ANSI both -Ae and -Aa option are required for C++ compiler.

Warning:Some code that is a warning in C may be a fatal error in aC++.

-AOa Command Line Option Syntax
-AOe Command Line Option Syntax

-AOa 
-AOe

Description

See corresponding C mode -Aa or -Ae option.
In addition to specifying the ANSI C language dialect, allows the optimizer to aggressively exploit the assumption that the source code conforms to the ANSI programming language C standard ISO 9899:1990. At present, the effect is to make +Otype_safety=ansi the default. As new independently-controllable optimizations are developed that depend on the ANSI C standard, the flags that enable those optimizations may also become the default under -AOa/-AOe.

-AP Command Line Option Syntax

-AP

Description:

Turns off -AA mode and uses the older C++ runtime libraries.

Note:This option is not supported in legacy HP C. This option is ignored with warnings in C++ C-mode.

+legacy_hpc Command Line Option Syntax

+legacy_hpc

Description:

This option enables the use of old HP-UX 11.20 ANSI C compiler.

This option is available in C++ C-mode only.

Note:This option is intended to be supported only in this release and may be deprecated in the next release. Use of this option is not recommended and use this option in discreet.

-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() {
   for (int k = 0; k!=100; ++k) {
      printf("%d\n", k);
   }
   return 100-k; // (1)
}

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.

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
Substitutes name in place of subprocess x.
-Wx,args
Passes the option arg to subprocess x of the HP aC++ compiling system.

-tx,name Command Line Option Syntax

-tx,name

Description:

Substitutes or inserts subprocess x using name.

This option works in two modes:

  1. If x is a single identifier, name represents the full path name of the new subprocess.
  2. 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.

Example:

aCC -taf,/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:

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/aCC 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    Assembler (standard suffix is as).
   c    Compiler (standard suffix is ctcom).
   C    See c.
   f    Filter tool (standard suffix is C++filt).
   l    Linker (standard suffix is ld).
   p    Preprocessor (standard suffix is cpp.ansi).
        -tp must be used before any -Wp options can be
        passed to cpp.ansi. Note: To enable the external
        preprocessor, use: -tp,/opt/langtools/lbin/cpp.ansi 
   u    Stand-alone code generator (standard suffix is
        u2comp)
   x    All subprocesses.
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.

If 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 -Wl,-v file.C
Compiles file.C and passes the option -v to the linker.

For More Information:

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.

This case is similar to the previous example, with additional options. -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]
where:

argoption
is the name of an option recognized by the subprocess.
argvalue
is a separate argument to argoption, where necessary.
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   Assembler (standard suffix is as).
   c   Compiler (Standard suffix is ctcom).
   C   See c.
   f   Filter tool (Standard suffix is C++filt).
   l   Linker (standard suffix is ld).
   p   Preprocessor (Standard suffix is cpp.ansi).
       -tp must be used before any -Wp options can be
       passed to cpp.ansi.
   x   All subprocesses.


Template Options

By using a template option on the aCC command line, you can:

+inst_compiletime
Causes the compiler to use the compile time (CTTI) instantiation mechanism to instantiate templates.
+inst_directed
Requests that no templates be instantiated (except explicit instantiations).
+inst_implicit_include
Requests HP C++ style template files.
+inst_include_suffixes
Requests HP C++ template definition file name suffixes.

Template Usage:

See Also:

Note:The template options are silently ignored in C++ C-mode.

+inst_compiletime Command Line Option Syntax

+inst_compiletime

Description:

Causes the compiler to use the compile time (CTTI) instantiation mechanism to instantiate templates. This occurs for every template used or explicitly instantiated in this translation unit and for which a definition exists in the translation unit. This is the default.

Note:This option is supported in C++ only but silently ignored in C++ C-mode.

+inst_directed Command Line Option Syntax

+inst_directed

Description:

Indicates to the compiler that no templates are to be instantiated (except explicit instantiations).

Usage:

If you are using only explicit instantiation, specify +inst_directed.

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 source file.

For More Information:

Note:This option is supported in C++ only but silently ignored in C++ C-mode.

+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.

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.

Note:This option is strongly discouraged and the sources should be modified to conform to the standard.

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:

Note:This option is supported in C++ only but silently ignored in C++ C-mode.

+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.

The default extensions in order of precedence are:

".c .C .cxx .CXX .cc .CC .cpp"

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.

Example:

+inst_include_suffixes ".c .C" Specifies that template definition files can have extensions of .c or .C.

Migration:

The +inst_include_suffixes option is equivalent to the HP C++ -ptS option.

For More Information:

Note:This option is supported in C++ only but silently ignored in C++ C-mode.


Requesting Verbose Compile and Link Information

Use the following options to obtain additional information about:

+dryrun
Requests compiler subprocess information without running the subprocesses.
+L
Enable any #pragma listing directives.
+O[no]clone
Causes cloning of functions.
+O[no]info
Requests optimization information.
+time
Requests execution times.
-v
Requests verbose information of the compilation process.
-V
Requests the current compiler and linker version numbers.
-Wl,-v
Requests verbose messages from the linker.

+dryrun Command Line Option Syntax

+dryrun

Description:

Generates 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.

+L Command Line Option Syntax

+L

Description:

Enable any #pragma listing directives and the listing facility. A straight listing prints the following: Under ANSI mode, -Wc,-L causes the compiler to generate an output list of the source without the cpp macro replacements. The -Wc,-Lp option causes the compiler to generate an output list of the source with the cpp macro replacements.

Note:This option is supported in legacy HP C only.

+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/hpux32/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/hpux32/libcl.a -lc /usr/lib/hpux32/libdld.so >/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/hpux32/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/hpux32/libcl.a -lc /usr/lib/hpux32/libdld.so >/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