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