- 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.
-mt Command Line Option Syntax |
-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:
+O[no]autopar Command Line Option Syntax |
+O[no]autopar
+Oparallel
option, +Oautopar
causes the compiler to parallelize loops that are safe to parallelize.
When used with +Oparallel, +Onoautopar causes
the compiler not to parallelize any loops.
A loop is safe to parallelize if it has an iteration count that can be determined at runtime before loop invocation; it must contain no loop-carried dependences, procedure calls, or I/O operations. A loop-carried dependence exists when one iteration of a loop assigns a value to an address that is referenced or assigned on another iteration.
+Oautopar is the default for all optimization levels but is useful only
at levels 3 and 4.
+O[no]dynsel Command Line Option Syntax |
+O[no]dynsel
+Oparallel,
the +Odynsel option
enables workload-based dynamic selection of parallelizable loops.
+Odynsel causes the compiler to generate either a
parallel or a serial version of the loop.
The loop's workload is compared to parallelization overhead,
and the parallel version is run only if it is profitable to do so.
The +Onodynsel option disables dynamic selection
and tells the compiler that it is profitable
to parallelize all parallelizable loops.
If a loop's iteration count is known at compile time, this optimization is performed at compile time. If a loop's iteration count is not known until runtime, the optimization is performed at runtime.
The default is +Odynsel if +Oparallel is enabled
at optimization level(s) 3 and 4.
+O[no]report[=report_type] Command Line Option Syntax |
+O[no]report[=report_type]
This option causes the compiler to display[not to display] various optimization reports.
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.
+tls=[static|dynamic] Command Line Option Syntax |
+tls=[static|dynamic]
+tls=modeThe 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.
-c Command Line Option Syntax |
-c
The compiler produces an object file (a file ending with
.o) for each source file (a file ending with .c, .C, .s,
or .i). Note that you must eventually link object files before they
can be executed.
aCC -c sub.C prog.CCompiles
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_modeldata_model can be one of the following:
| ILP32 Data Model | LP64 Data Model |
|---|---|
| The size of an int, long, or pointer data type is 32-bits. | The size of an int data type is 32-bits. The size of a long or pointer data type is 64-bits. |
| The preprocessor predefined macro _ILP32 is defined. |
The preprocessor predefined macro,
__LP64__
is defined. Also __LP64__ and _LP64.
|
aCC +DD64 app.CThe following example generates code for the 32-bit data model.
aCC app.C
+DSmodel Command Line Option Syntax |
+DSmodelmodel 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
Object code with scheduling tuned for a particular model will execute on other HP 9000 systems, although possibly less efficiently.
When you use the +DS option depends on your particular circumstances.
+DS option. The compiler
generates code tuned for your system.
+DSmodel with either the model number of the target system or
the processor name of the target system.
-S Command Line Option Syntax |
-S
.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).
aCC -S prog.CCompiles
prog.C to assembly code rather than to object code, and puts the
assembly code in the file prog.s.
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 Command Line Option Syntax |
-Bdefault
-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.
-Bdefault=symbol[,symbol...]The named symbols are assigned the default export class.
-Bdefault:filenameThe 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
-Bextern is applied to a listed
symbol that is resolved in the same load module.
-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:filenameThe 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
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.
-Bhidden=symbol[,symbol...]The named symbols, or all symbols if no symbols are specified, are assigned the hidden export class.
-Bhidden:filenameThe 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
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.
-Bprotected_dataMarks only data symbols as having the protected export class.
-Bprotected_defSame as
-Bprotected but only locally defined (non-tentative)
symbols
are assigned the protected export class.
-Bprotected:filenameThe 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
-Bprotected with no symbol list.
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.
+d Command Line Option Syntax |
+d
This option is useful when you are debugging your code because you cannot set breakpoints at inline functions. This option defeats inlining thereby allowing you to set breakpoints at functions specified as inline.
-g Command Line Option Syntax |
-g
-g causes the compiler to
generate minimal information for the debugger.
It uses an algorithm that attempts to reduce duplication of debug information.
To suppress expansion of inline functions use the +d option.
-g0 Command Line Option Syntax |
-g0
-g0 causes the compiler to generate full debug information for the debugger.
To suppress expansion of inline functions use the +d option.
-g1 Command Line Option Syntax |
-g1
-g1 causes
the compiler to
generate minimal information for the debugger.
It uses an algorithm that attempts to reduce
duplication of debug information.
To suppress expansion of inline functions use the +d option.
-g0 option emits full debug information about every
class referenced in a file, which can result in some redundant information.
The -g and -g1 options, on the other hand, emit a
subset of this debug information, thereby decreasing the size of your object
file. If you compile your entire application with -g or -g1 no debugger functionality is lost.
NOTE:
If you compile part of an application with -g or -g1 and part with debug off,
(that is, with neither the -g, the -g0, nor the -g1 option) the resulting
executable may not contain complete debug information.
You will still be able to run the executable, but in the debugger, some
classes may appear to have no members.
If there are no virtual member functions, the compiler looks for the first non-inline member function.
If there are no non-inline member functions, debug information is always generated.
A problem occurs if all functions are inline;
in this case, no debug information is generated.
+[no]objdebug Command Line Option Syntax |
+[no]objdebug
CAUTION:
With +objdebug, the object files or archive libraries must not be removed.
+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.
+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.
+p Command Line Option Syntax |
+p
Ordinarily, the compiler gives warnings about anachronistic constructs. Using
the +p option, the compiler gives errors for anachronistic constructs.
aCC +p file.CCompiles
file.C and gives errors for all anachronistic constructs rather
than just giving warnings.
+Mn Command Line Option Syntax |
+Mn
-w Command Line Option Syntax |
-w
By default, compiler reports all errors and warnings.
aCC -w file.CCompiles
file.C and reports errors but does not report any warnings.
+w Command Line Option Syntax |
+w
The default is to warn only about constructs that are almost certainly problems.
For example, this option warns you when calls to inline functions cannot be expanded inline.
aCC +w file.CCompiles
file.C and warns about both questionable constructs and
constructs almost certainly problematic.
Note:This option is equivalent to +w1 option
of legacy HP C.
+wn Command Line Option Syntax |
+wn
+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]
aCC +W600 app.C
+Weargs Command Line Option Syntax |
+Wearg1[,arg2,..argn]
aCC +We 600,829 app.C
+Wwargs Command Line Option Syntax |
+Wwarg1[,arg2,..argn]
+W, +Ww and +We are resolved based on their severity. +We is the highest and +W is the lowest.
+noeh Command Line Option Syntax |
+noeh
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.
aCC +noeh progex.CCompiles and links
progex.C, which does not use
exception handling.
-ext Command Line Option Syntax |
-ext
-ext, you are enabling the following HP aC++
extensions to the C++ standard:
| HP aC++ Extentions |
|---|
Enable 64-bit integer data type support for:
Use this option to declare 64-bit integer literals and for input and output of 64-bit integers. |
Enable #assert and
#unassert
preprocessor directives allowing
you to set a predicate name or predicate name and token to be tested with a
#if directive.
|
Note, when using -ext, specify it at both compile and link time.
aCC -ext foo.CCompiles
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
-ext.
+f Command Line Option Syntax |
+f
+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
#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
+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
-fpeval=float.
-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
__float80
prototypes. The compiler defines _FPWIDETYPES when
-fpwidetypes is in effect. The default is
-nofpwidetypes.
+FP Command Line Option Syntax |
+FP[flags]
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
errno in libm functions.
The default is +Onolibmerrno. +Olibmerrno with -Aa option.
+r Command Line Option Syntax |
+r
Note:This option is supported in legacy HP C only.
#include files.
-Idirectory Command Line Option Syntax |
-I directory
directory is the HP-UX directory where the compiler looks for header files.
#include files during preprocessing.
During the link phase, adds directory to the directories to be
searched for #include files by the link-time template processor.
For #include files that are enclosed in double quotes
(" ")
within a source file and do not begin with a /, the preprocessor searches in
the following order:
#include.
-I option.
For #include files that are enclosed in angle brackets (< >), the preprocessor searches in the following order:
-I option.
(The current directory is not searched when angle brackets (< >)
are used with #include.)
aCC -I include file.CThis 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.
Specifying -I- serves a dual purpose, as follows:
(" ")
file names in a #include directive to the following order:
-I option.
Angle-bracket enclosed file names in a #include directive are searched for only in the -I directories specified after -I- on the command-line. Quoted includes are searched for in the directories that both precede and follow the -I- option.
Without view-pathing, there is no way to completely replace the default -Idirectory search-path with one customized specifically for project development.
With view-pathing, you can designate and separate official directories from development directories and enforce an unconventional search-path order. For quote enclosed headers, the preprocessor can include any header files located in development directories and, in the absence of these, include headers located in the official directories.
If -I- is not specified view-pathing is turned off. This is the default.
aCC -Idir1 -Idir2 -c a.CWith view-pathing on, the following example searches for quoted include files in dir1 first and dir2 next, followed by the standard include directories, ignoring the directory of a.C. Angle-bracketed includes are searched for in dir2 first, followed by the standard include directories.
aCC -Idir1 -I- -Idir2 -c a.CCAUTION: Some of the compiler's header files are included using double quotes. Since the -I- option redefines the search order of such includes, if any standard headers are used, it is your responsibility to supply the standard include directories (/opt/aCC/include* and /usr/include) in the correct order in your -I- command line.
For example, when using -I- on the aCC command line, any specified -I directory containing a quoted include file having the same name as an HP-UX system header file, may cause the following possible conflict. (In general, if your application includes no header having the same name as an HP-UX system header, there is no chance of a conflict.)
Suppose you are compiling program a.C with view-pathing on. a.C includes the file a.out.h which is a system header in /usr/include:
aCC -IDevelopmentDir -I- -IOfficialDir a.CIf a.C contains:
// This is the file a.C #include <a.out.h> // ...When a.out.h is preprocessed from the /usr/include directory, it includes other files that are quote included (like #include "filehdr.h").
Since with view-pathing, quote enclosed headers are not searched for in the including file's directory, filehdr.h which is included by a.out.h will not be searched for in a.out.h's directory (/usr/include). Instead, for the above command line, it is first searched for in DevelopmentDir, then in OfficialDir and if it is found in neither, it is finally searched for in the standard include directories (/opt/aCC/include* and /usr/include) in the latter of which it will be found.
However, if you have a file named filehdr.h in DevelopmentDir or OfficialDir, that file (the wrong file) will be found.
+help Command Line Option Syntax |
+help
If +help is used on any command line, the compiler displays the online
programmer's guide with the default web browser and then processes any
other arguments.
If $DISPLAY is set, the default web browser is 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)
export BROWSER=AlternateBrowserLocationTo invoke the online guide:
aCC +help
+inline_level [i]num Command Line Option Syntax |
+inline_level [i]num
This option controls how C++ inlining hints influence HP aC++. Such inlining happens in addition to 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).
aCC +inline_level3 app.C
+A Command Line Option Syntax |
+A
aCC +A file.o -lmLinks
file.o and links in the archived version of the math library,
/lib/libm.a, rather than the shared version,
/lib/libm.so,
and does not link in /usr/lib/hpux32/libdld.so.
-a linker option
-b Command Line Option Syntax |
-b
aCC -b utils.o -o utils.soLinks
utils.o
and creates the shared library utils.so.
-dynamic Command Line Option Syntax |
-dynamic
-minshared for
partially
statically bound executables. The default is -dynamic.
-exec Command Line Option Syntax |
-exec
-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 |
-lnameThe name parameter forms part of the name of a library the linker searches for when looking for routines called by your program.
/usr/lib/lib/hpux32/name.so
/usr/lib/lib/hpux32/name.a
/opt/langtools/lib/hpux32lib/name.so
/opt/langtools/lib/hpux64lib/name.a
.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.)
aCC file.o -lnumeric
This example directs the linker to link file.o and (by default)
search the library /usr/lib/hpux32/libnumeric.so.
-L directory Command Line Option Syntax |
-L directoryThe directory parameter is the HP-UX directory where you want the linker to search for libraries your program uses before searching the default directories.
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.
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).
-minshared Command Line Option Syntax |
-minshared
-exec -Bprotected.
+nostl Command Line Option Syntax |
+nostl
CAUTION: Complete understanding of the linking process and the behavior of the actual (third party) libraries linked with the application is essential for avoiding link or run-time failures.
In addition, you can use the -Wl,args compiler option to specify any linker option on the compiler command line. For more information on linker options, see the ld(1) man page or the HP-UX Reference Manual.
CAUTION: You must use the aCC command to link your HP aC++ programs and libraries. This ensures that all libraries and other files needed by the linker are available.
-n Command Line Option Syntax |
-n
ld in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-N Command Line Option Syntax |
-N
Unsharable executable files generated with the -N option cannot
be executed with exec.
ld description in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-q Command Line Option Syntax |
-q
ld in the
HP-UX Reference Manual or the ld(1) man page if it is installed
on your system. (If you see the message "Man page could not be formatted,"
ensure the man page is installed.)
-Q Command Line Option Syntax |
-Q
-r Command Line Option Syntax |
-r
-s Command Line Option Syntax |
-s
Specifying this option prevents using a symbolic debugger on the resulting program.
-u Command Line Option Syntax |
-usymbol
-u.
See ld(1) manpage for more information.
+ild Command Line Option Syntax |
+ild
+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.
+ildrelink Command Line Option Syntax |
+ildrelink
+ildrelink option allows you to avoid such unexpected initial
incremental links by periodically rebuilding the output file.
-eepsym Command Line Option Syntax |
-eepsym
epsym=xec.
-o Command Line Option Syntax |
-o outfile
The outfile parameter is the name of the file containing the
output of the compilation.
Without this option the default name is a.out.
When compiling a single source file with the -c
option, you can use the -o option to specify the name and location
of the object file.
-.suffix Command Line Option Syntax |
-.suffixThe suffix parameter represents the character or characters to be used as the output file name suffix.
suffix cannot be the same as the original source file name suffix.
.c file.
aCC -E -.i prog.CPreprocesses the code in
prog.C and puts the resulting code
in the file prog.i.
-Y Command Line Option Syntax |
-Y
The language value (refer to environ(5) for the LANG environment variable) is used to initialize the correct tables for interpreting
comments, string literals, and character constants. The language value
is also used to build the path name to the proper message catalog.
hpnls, lang, and environ in the
HP-UX Reference Manual for a description of the NLS model.
-z Command Line Option Syntax |
-z
Fatal errors result if null pointers are dereferenced.
If you attempt to dereference a null pointer, a SIGSEGV
error occurs at run time.
aCC -z file.CCompiles
file.C and generates code to disallow dereferencing
of null pointers.
-Z Command Line Option Syntax |
-Z
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.
-O Command Line Option Syntax |
-O
aCC -O prog.CCompiles
prog.C and optimizes at level 2.
+O0 Command Line Option Syntax |
+O0
aCC +O0 prog.CCompiles
prog.C and optimizes at level 0.
+O1 Command Line Option Syntax |
+O1
aCC +O1 prog.CCompiles
prog.C and optimizes at level 1.
+O2 Command Line Option Syntax |
+O2
aCC +O2 prog.CCompiles
prog.C and optimizes at level 2.
+O3 Command Line Option Syntax |
+O3
aCC +O3 prog.CCompiles
prog.C and optimizes at level 3.
+O4 Command Line Option Syntax |
+O4
+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:
+O4 only those
modules that need to be compiled at optimization level 4, and compile
the remaining modules at a lower level.
maxdsiz process parameter from 64 MB to 128 MB.
This procedure provides the process with additional data space.
Refer to the System Administration Tasks manual, Chapter 11,
"Reconfiguring the HP-UX Kernel." See Appendix A for full
descriptions of the different process parameters, including
maxdsiz.
For a complete discussion of swap space, refer to How HP-UX Works: Concepts for the System Administrator.
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.
aCC +O4 prog.CCompiles
prog.C and optimizes at level 4.
+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.
+O[no]clone Command Line Option Syntax |
+O[no]clone
+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.
$ cc -c +P +O4 foo.c +Onoclone $ cc -c +P +O4 bar.cin 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
+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
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.
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.
+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.
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.
+Oparmsoverlap +Onomoveflops.
The default is +Onoconservative.
+O[no]limit Command Line Option Syntax |
+O[no]limit
+Olimit option enables optimizations that significantly
increase compile-time or that consume a lot of memory.+Onolimit option supresses optimizations regardless of their effect
on compile time or memory consumption.+Onolimit at all optimization levels.
+O[no]limit=levelThe 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.
+Onolimit as follows:
aCC <opt level> +Onolimit sourcefile.C
+O[no]ptrs_ansi Command Line Option Syntax |
+O[no]ptrs_ansi
+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
+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
+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
+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 optimization options provide additional control for special situations.
+O[no]cross_region_addressing Command Line Option Syntax |
+O[no]cross_region_addressing
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
+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.
+Odataprefetch=kindThe 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.
+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
+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).
+Ofltacc=levelThe 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.
+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...]
+Ofrequently_called:filename
+O[no]initcheck Command Line Option Syntax |
+O[no]initcheck
+Oinitcheck), the optimizer initializes to zero
any local,
non-static variables that are uninitialized with respect to at least
one path leading to a use of the variable.
+Onoinitcheck), the optimizer does not initialize uninitialized variables, but issues warning messages when it discovers them.
Use +Oinitcheck at optimization level 2 or above.
+O[no]inline Command Line Option Syntax |
+O[no]inline
+Oinline option indicates that any function can be inlined by the
optimizer. +Onoinline disables inlining of functions by the optimizer.
This option does not affect functions inlined at the source code level.
Use +Onoinline at optimization levels 3 or 4.
The default is +Oinline at optimization levels 3 and 4.
+O[no]inline=function1{,function2...]
Enables [disables] optimizer inlining for the named functions.
+O[no]inline:filenameThe file indicated by filename should contain a list of function names, separated by commas or newlines. Optimization is enabled [disabled] for the named functions.
+Oinlinebudget Command Line Option Syntax |
+Oinlinebudget=n
+Oinlinebudget option controls the aggressiveness of
inlining according to the value you specify for n
where n is an integer in the range 1 - 1000000 that specifies the
level of aggressiveness, as follows:
The +Onolimit and
+Osize
options also affect inlining.
Specifying the +Onolimit option has the same effect
as specifying +Oinlinebudget=200.
The +Osize option has the same effect as
+Oinlinebudget=1.
Note, however, that the +Oinlinebudget option takes
precedence over both of these options.
This means that you can override the effect of +Onolimit
or +Osize option on inlining
by specifying the +Oinlinebudget option on the same compile line.
Use this option at optimization level 3 or higher.
The default is +Oinlinebudget=100.
+O[no]inline option.
+Olit Command Line Option Syntax |
+Olit=kind
+Olit=all is the default in aCC and +Olit=const
is the default in C.
+Olit=kind The defined values for kind are:
all
All string literals and all const-qualified
variables that do not require load-time or
run-time initialization will be placed in a
read-only data section. +Olit=all replaces the
deprecated +ESlit option.
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]
+Ointeger_overflow=kindThe 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]
This option works as does the OPT_LEVEL pragma. The option overrides the pragma for the specified functions. As with the pragma, you can only lower the level of optimization; you cannot raise it above the level specified by a basic +Olevel or -O option. To avoid confusion, it is best to use either this option or the OPT_LEVEL pragma rather than both.
You can use this option at optimization levels 1, 2, 3, and 4. The default is to optimize all functions at the level specified by the basic +Olevel or -O option.
aCC +O3 +O1=myfunc1,myfunc2 funcs.c main.cThe following command optimizes all functions at level 2, except for the functions myfunc1 and myfunc2, which it optimizes at level 0.
aCC -O +O0=myfunc1,myfunc2 funcs.c main.c
+O[no]libcalls Command Line Option Syntax |
+O[no]libcallsNote: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.
+Onolibcalls.
Use +O[no]libcalls at any optimization level.
+O[no]loop_block Command Line Option Syntax |
+O[no]loop_block
+O[no]loop_block option enables [disables] blocking
of eligible loops for improved cache performance.
The default is +Onoloop_block and can be used at optimization level(s) 2, 3, and 4.
+O[no]loop_transform Command Line Option Syntax |
+O[no]loop_transform
+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.
+O[no]loop_unroll Command Line Option Syntax |
+O[no]loop_unroll[=unroll_factor]
+Oloop_unroll. The default
is 4, that is, four copies of the loop body. The unroll_factor
controls code expansion.
+O[no]loop_unroll_jam Command Line Option Syntax |
+O[no]loop_unroll_jam
+O[no]loop_unroll_jam option enables [disables]
loop unrolling and jamming.
Loop unrolling and jamming increase register exploitation.
The default is +Onoloop_unroll_jam at optimization
level(s) 3 and 4 only.
+O[no]moveflops Command Line Option Syntax |
+O[no]moveflopsNote: The option is deprecated and may not be supported in future releases.
+Omoveflops. The +Onomoveflops
option is approximately equivalent to +Ofltacc=strict +Ofenvaccess.
+O[no]openmp Command Line Option Syntax |
+O[no]openmp
+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
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
+opts option.
+O[no]parminit Command Line Option Syntax |
+O[no]parminit
+Onoparminit.
+O[no]parmsoverlap Command Line Option Syntax |
+O[no]parmsoverlap
+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
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
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...]
+Orarely_called:filename
+O[no]recovery Command Line Option Syntax |
+O[no]recovery
+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
+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]
+Oshortdata=8.
+Ostore_ordering Command Line Option Syntax |
+O[no]store_ordering
+Onostore_ordering.
+Otype_safety Command Line Option Syntax |
+Otype_safety=kind
+Otype_safety=off
+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
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
+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
+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 is a set of performance-improving code transformations based on the run-time characteristics of your application.
+dfname Command Line Option Syntax |
+dfnameNote:This option is deprecated in HP-UX 11i V1.6 IPF release.
+P with +df filename, you can
use +Oprofile=use:filename.
+Oprofile Command Line Option Syntax |
+Oprofile=[use|collect]
+Oprofile=collect is equivalent to +I.
+Oprofile=use[:filename] causes the compiler to look
for a profile
database file. Overrides the FLOW_DATA environment variable. This
option is a synonym for +df and
+P.
After compiling and linking with +Oprofile=collect, run the
resultant program
using representative input data to collect execution profile data.
Finally, recompile with the +Oprofile=use option
to perform profile-based optimization.
Profile data is stored in flow.data by default. See the
+Oprofile=use:filename option for information on
controlling the name and location of this data file.
aCC +Oprofile=collect -O -c prog.C aCC +Oprofile=collect -O -o prog.pbo prog.oCompiles
prog.C with optimization, prepares the object code
for data collection, and creates the executable file prog.pbo.
Running prog.pbo
collects run-time information in the file flow.data in
preparation for optimization with +Oprofile=use.
+I Command Line Option Syntax |
+INote:This option is deprecated in HP-UX 11i V1.6 IPF release. Instead you can use
+Oprofile=collect.
+Oprofile=collect
.
+P Command Line Option Syntax |
+PNote: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.
+Oprofile=use
.
+Oreusedir=path |
+Oreusedir=path
+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.
+O[no]info Command Line Option Syntax |
+O[no]info
+Oinfo displays informational messages about the optimization process.
This option may be helpful in understanding what optimizations are occurring.
You can use the option at levels 0-4.
The default is +Onoinfo at levels 0-4.
-fast Command Line Option Syntax |
-fast
-fast option selects a combination of optimization options for
optimum execution speed for reasonable build times. Currently
chosen options are:
-fast by specifying a
subsequent option after it. This option is a synonym for +Ofast.
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
+Ofast option selects a combination of optimization options for
optimum execution speed for reasonable build times. Currently
chosen options are:
-fast.
+Ofaster Command Line Option Syntax |
+Ofaster
+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
+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.
+sb Command Line Option Syntax |
+sb
+sb.
Note:When both +sb and +uc are
in effect, +uc will override this for char bit fields.
+ub Command Line Option Syntax |
+ub
+sb.
+uc Command Line Option Syntax |
+uc
+uc causes an unqualified (plain) char data type to be
treated as unsigned char. (Overloading and mangling are unchanged.)
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.
stdout.
.i file.
.suffix.
-C Command Line Option Syntax |
-C
-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).
#define.
If no definition (def) is given, the name is defined as "1".
Note:__ia64 and __HP_aCC are
defined automatically.
aCC -DDEBUGFLAG file.CDefines the preprocessor symbol
DEBUGFLAG and gives it the value 1.
Following is a program that uses this symbol.
#include <iostream.h>
void main(){
int i, j;
#ifdef DEBUGFLAG
int call_count=0;
#endif
...
}
-E Command Line Option Syntax |
-E
stdout). Note an exception to this rule when -E is used with either the
+m[d]
or
+M[d]
option, only make(1) dependency information is output.
Unlike the -P option, the output of -E contains #line entries indicating the original file and line numbers.
+m[d] Command Line Option Syntax |
+m[d]
If +md is specified, the list is directed to a .d file.
The .d file name prefix is the same as that of the object file.
The .d file is created in the same directory as the object file.
+m[d] when you also specify the -E or the
-P option.
Used with the -E option, only dependency information is generated.
| command line specified | .d file name | .d file location | preprocessing output |
|---|---|---|---|
| aCC -c +m a.C | none | stdout | none |
| aCC -c -E -.i +md a.C | a.d | current directory | none |
| aCC -c -P +md a.C -o b.o | b.d | current directory | 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]
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.
+Md when you also specify the -E or the
-P option.
Used with the -E option, only dependency information is generated.
| command line specified | .d file name | .d file location | preprocessing output |
|---|---|---|---|
| aCC -c +M a.C | none | stdout | none |
| aCC -c -E -.i +Md a.C | a.d | current directory | none |
| aCC -c -P +Md a.C -o b.o | b.d | current directory | a.i |
| aCC -c -P +Md a.C -o /tmp/c | c.d | /tmp directory | a.i |
-P Command Line Option Syntax |
-P
.i.
aCC -P prog.CPreprocesses the file
prog.C leaving the output in the file prog.i.
Does not compile the program.
-Uname Command Line Option Syntax |
-Unamename is the symbol name whose definition is removed from the preprocessor.
A name can be a definition set by HP 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.
gprof.
prof.
prof and gprof.
-G Command Line Option Syntax |
-G
-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.
aCC -G file.CCompiles
file.C and creates the executable file a.out
instrumented for use with gprof.
-p Command Line Option Syntax |
-p
-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.
aCC -p file.CCompiles
file.C and creates the executable file a.out
instrumented for use with prof.
+profilebucketsize Command Line Option Syntax |
+profilebucketsize=[16|32]
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.
for statements.
-Aa Command Line Option Syntax |
-Aa
-Ae
option for C++ C-mode description.
-Aa are incompatible
with earlier C and C++ features.
-AA Command Line Option Syntax |
-AA
-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.
-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.
-Ac Command Line Option Syntax |
-Ac
Note:This option is supported in legacy HP C only.
-Ae Command Line Option Syntax |
-Ae
-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
|
-AOa
-AOe
-AOa/-AOe.
-AP Command Line Option Syntax |
-AP
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
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]
for statements; the scope of the
declaration then ends with the scope of the loop body.
By default, the option is disabled.
#includeint 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]
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);
}
-tx,name Command Line Option Syntax |
-tx,name
This option works in two modes:
aCC -taf,/users/sjs/myasmb file.sInvokes the assembler
/users/sjs/myasmb instead of the default assembler
/usr/ccs/bin/as to assemble and link file.s.
-t.
-W allows you
to pass options to subprocesses.)
aCC -tf,/new/bin/c++filt file.CCompiles
file.C and specifies that
/new/bin/c++filt should be used rather than the default
/opt/aCC/bin/c++filt.
aCC -tC,/users/proj/ctcom file.CCompiles
file.C and specifies that /users/proj/ctcom
should be used instead of the default /opt/aCC/lbin/ctcom.
aCC -tx,/new/aCC file.CCompiles
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.
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.
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]
-argoption[,argvalue]
-Wc,-diagnose_includes,on option.
aCC -Wc,-diagnose_includes,on file.CSpecify
-Wc,-diagnose_includes,off (the default)
to turn the option off.
aCC -Wl,-v file.CCompiles
file.C and passes the option -v to the
linker.
-t allows you to substitute
subprocesses in place of the defaults.)
aCC file.o -Wl,-a,archive -lmLinks
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.
aCC -Wl,-a,archive,-m,-v file.o -lmLinks
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.
-W option takes
the form:
-argoption[,argvalue]where:
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 Usage:
+inst_compiletime Command Line Option Syntax |
+inst_compiletime
Note:This option is supported in C++ only but silently ignored in C++ C-mode.
+inst_directed Command Line Option Syntax |
+inst_directed
+inst_directed.
aCC +inst_directed prog.CCompiles
file.C with the resulting object file containing no
template instantiations, except for any explicit instantiations coded in
your source file.
+inst_implicit_include Command Line Option Syntax |
+inst_implicit_include
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.
aCC +inst_implicit_include prog.CIf 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.
+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.
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.
.c or .C.
-ptS option.
#pragma listing directives.
+dryrun Command Line Option Syntax |
+dryrun
aCC +dryrun app.CThe above command line gives the same kind of information as the -v option but without running the subprocesses.
+L Command Line Option Syntax |
+L
#pragma listing directives and the listing facility.
A straight listing prints the following:
-C option is used).
-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
aCC +time app.Cgenerates information like this:
process: compiler 0.94/u 0.65/s 4.35/r process: ld 0.37/u 0.76/s 3.02/rThe following command line:
aCC -v +time app.Cgenerates 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
stderr.
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
aCC -V app.C
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