Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

\.\"
.\"  THIS DOCUMENT COMBINES THE C AND C++ DRIVER MAN PAGES.  SEE COMMENT BELOW
.\"  ON HOW TO DELIVER THE TWO DIFFERENT DOCUMENTS.
.\"
.\"   print with "troff -man <file>"
.\"
.am }C
.ds ]D HP OSF/1 Technology Release
..
.ig
.\" macro to document internal implementation (switch setting to pass to real compiler)
.de iM
.RS
.sp .1
\fIImplementation: \fP
.ie !'\\$1'' \\$1
.el \fI   \-TBD\- \fP
.sp .5
.RE
..
.de cC                  \" .cC "C output" "CC output"
.ie !\\n(CC \\&\\$1
.el \\&\\$2
..
.\" ************************************************************
.\" ************************************************************
.\" This document is the combined C++, CC man page, and the C c89 man page.
.\" ONE of the two lines following the row of ~'s needs to be uncommented.
.\" Setting CC to 1 will allow you to produce a C++ man page and setting CC to
.\" 0, will allow you to produce a c89 man page.  This man page must be
.\" delivered separately for the C and C++ products.  To deliver this document
.\" for C++ uncomment the line setting CC to 1, and name the document "CC.1".
.\" To deliver this document for C uncomment the line setting CC to 0, and name
.\" the document (cc.1 and c89.1).
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.nr CC 1                \" Print out C++ CC manual
.\" .nr CC 0            \" Print out C cc manual
.\" ************************************************************
.\" ************************************************************
.ie \n(CC .TH CC 1\" C++
.el .TH cc 1\" C
.SH NAME
.ie !\n(CC \fBcc\fR, \fBc89\fR \- C compiler
.el \fBCC\fR \- C++ compiler
.ie !\n(CC \{           \" C synopsis
.SH SYNOPSIS
.B cc
.RI [ \|options\| ]
.RI [ \|operands\| ]
.br
.B c89
.RI [ \|options\| ]
.RI [ \|operands\| ]
\}
.el \{                  \" C++ synopsis
.SH SYNOPSIS
\fBCC \fR[ \fIoption \fR| \fIfilename \fR] ... \fIfilename \fR[ \fIoption \fR| \fIfilename \fR] ...
\}
.if !\n(CC \{           \" C introduction
.SH DESCRIPTION
.B cc
and
.B c89
are equivalent names for the
HP OSF/1 TR C compiler.
.RB ( c89
is the name mandated by
POSIX;
.B cc
is the traditional command name.  At HP OSF/1 TR,
.B cc
and
.B c89
behave identically.)
Both commands accept several types of arguments as
.I operands :
\}
.if \n(CC \{            \" C++ introduction
.SH DESCRIPTION
.B CC
is the driver for the C++ compiling system, which consists of a preprocessor
(\fBc++cpp\fR),
a translator (\fBcfront\fR), a C compiler (\fBcc\fR), a link editor (\fBld\fR),
a constructor linker (\fBc++patch\fR), an error message decoder (\fBc++filt\fR), and a debug
translator (\fBc++merge\fR).
.B CC
translates programs written in the C++ programming language
into executable load modules, relocatable binary programs for subsequent resolution by
the link editor, or C language modules.
\}
.RS
.TP 3
\(bu
Arguments whose names end with
.cC \fB.c\fP  \fB.C\fP
are understood to be
.cC C C++
source files.
Each is compiled and the resulting object file is left
in a file having the corresponding basename, but suffixed with
.B .o
instead of
.cC \fB.c\fP.  \fB.C\fP.
However, if a single
.cC C C++
file is compiled and linked, all in one step, the
.B .o
file is deleted.
.TP
\(bu
Similarly, arguments whose names end with
.B .s
are understood to be assembly source files and are assembled, producing a
.B .o
file for each
.B .s
file.
.TP
\(bu
Arguments whose names end with
.B .i
are assumed to be the output of
.ie \n(CC .BR c++cpp
.el .BR cpp (1)
(see the
.B \-P
option below).
They are compiled without again invoking
.ie \n(CC .BR c++cpp .
.el .BR cpp (1).
Each object file is left in a file having the corresponding
basename, but suffixed with
.B .o
instead of
.BR .i .
.TP
\(bu
Arguments of the form
.BI \-l x
cause the link editor to search the library
.BI lib x .so
or
.BI lib x .a
in an attempt to resolve currently unresolved external references.
Because a library is searched when its name is encountered,
placement of a
.B \-l
is significant.
If a file contains an unresolved external reference,
the library containing the definition must be placed
.I after
the file on the command line.
See
.BR ld (1)
for further details.
.TP
\(bu
All other arguments, such as those whose names end with
.BR .o ,
.BR .so ,
or
.BR .a ,
are taken to be relocatable object files
that are to be included in the link operation.
.RE
.ie \n(CC \{            \" C++ Note
.TP 9
\fBNOTE:\fR
For backward compatibility and as a transition from other platforms, the \fBCC\fR driver
also treats files with the suffix pattern \fB.c*\fR or \fB.C*\fR as C++ source files.
For instance, \fB.c\fR, \fB.cxx\fR, \fB.cc\fR, and \fB.cpp\fR suffixes are treated
as C++ source files.
.PP 0
\}
.el .PP
Arguments and options can be passed to the compiler through the
.SM
.cC \fBCCOPTS\fP  \fBCXXOPTS\fP
environment variable as well as on the command line.
The compiler reads the value of
.SM
.cC \fBCCOPTS\fP  \fBCXXOPTS\fP
and divides these options into two sets; those options which appear before
a vertical bar
.RB ( \||\| ),
and those options which appear after the vertical bar.
The first set of options are placed before any of the command-line
parameters to
.cC \fBcc;\fP  \fBCC;\fP
the second set of options are placed after the command-line parameters to
.cC \fBcc.\fP  \fBCC.\fP
If the vertical bar is not present,
all options are placed before the command-line parameters.
For example (in
.BR sh (1)
notation),
.PP
.RS
.ft B
.ie !\n(CC .SM CCOPTS\c
.el .SM CXXOPTS\c
="\-v | \-lmalloc"
.br
export
.ie !\n(CC .SM CCOPTS
.el .SM CXXOPTS
.br
.cC cc CC
\-g prog.c
.ft R
.RE
.PP
is equivalent to
.PP
.RS
.ft B
.cC cc CC
\-v \-g prog.c \-lmalloc
.ft R
.RE
.PP
When set, the
.SM
.B TMPDIR
environment variable specifies a directory
to be used by the compiler for temporary files,
overriding the default directories
.B /tmp
and
.BR /usr/tmp .
.SS OPTIONS
.br
.TP 15
\fB \-A \fIoption-name\fR | \fIoption-name\fB:\fIoption-arguments\fR | \fIoption-name\fI=\fIoption-arguments\fR
Introduce options specific to HP OSF/1 TR under a single letter.
Arguments are \fIoption-name\fPs either with or without \fIoption-arguments\fP,
separated from the \fIoption-name\fP with either a \fB:\fR or a \fB=\fR
character.  Both these characters are accepted with all
\fIoption-name\fPs.
.PD
Valid \fIoption-name\fP arguments to the \fB\-A\fR option are:
.RS
.ig  \" delete alignment stuff for the time being   /drl 910814
.TP
\fBalign:\fR{ \fBnatural\fR |\fB nopadding\fR |
.PD 0
.TP
\fB hpux_word\fR |\fB hpux_natural\fR | \fB hpux_natural_s500\fR |
.PD 0
.TP
\fB domain_word\fR |\fB domain_natural \fR}
Set the alignment mode.  By default the alignment mode is
.B natural.
More information on alignment can be found in the
.IR "C Programmer's Guide" .
..  \" end ignore
.ig      \" delete align_err_level till after Acorn --kh 910930
.\"  ------------ align_err_level
.TP
\fBalign_err_level:\fP{ \fB0 | 2 | 4 | 6 | 8 \fP}
Set the severity level for diagnostics concerning alignment problems.
The default is 6 ((???)).
..  \" end ignore
.iM
.\"  ------------ gen:
.TP
\fBgen:\fR{\fBpic\fR | \fBno_pic\fR }
.ig \" suppress float for now -- not in Acorn
 \fBfloat\fR |
..  \" end ignore
Control subtle features of code generation.
.ig \" suppress float for now -- not in Acorn
.BR float
forces floats to be treated as floats (i.e. does not promote floats
to double).
.BR float
is not a valid argument with the ANSI compiler.
..  \" end ignore
.\"  ------------ gen: pic
.BR pic
causes position-independent code to be generated (default).
.BR no_pic
indicates that non-position-independent code is acceptable.  (For HP OSF/1 TR,
this directive is accepted and ignored; only position-independent code is
produced by the current compiler.)
.iM
.if !\n(CC \{           \" Not supported by C++
.PD
.\"  ------------ softstatic
.TP
.B softstatic
Generate additional information needed by static analysis
tools, and ensure that the program is linked as required
for static analysis.  (See HP \fBSoftBench\fP documentation for more information.)
.iM
\}
.if !\n(CC \{           \" Not supported by C++
.TP
{ \fBuse_dff\fR | \fBno_use_dff\fR }
Tell \fBcc\fR whether to use the \fBdff\fR command, a version of \fBlint\fR that
issues warnings about Domain extensions to the C language that will not be
accepted in future releases of HP OSF/1 C.  The default is \fB\-A no_use_dff\fR.
\}
.RE
.if \n(CC \{            \" C++ +a option
.TP
\fB+a\fR{ \fB0 \fR| \fB1 \fR}
The translator can generate either ANSI C declarations (with function
prototypes) or non-ANSI C declarations (without function prototypes).  \fB+a0\fR
causes the translator to produce non-ANSI declarations.  \fB+a1\fR (the default) causes
the translator to emit ANSI C function prototypes in the C output.  Note that
function prototypes suppress argument widening; the suppression of argument
widening can change the behavior of function calls.
.IP
If you specify the \fB+a\fR option more than once on a command line, the \fBCC\fR driver
ignores all but the last specification, and it applies to all files on the
command line.
.IP
\fBNOTE:\fR  The HP OSF/1 TR C++ libraries do not support non-ANSI declarations.
.iM
\}                      \" End of +a option
.TP
.B \-c
Suppress the link edit phase of the compilation, and force
an object
.RB ( .o )
file to be produced (and retained) for each
.cC \fB.c\fP \fB.C\fP
file even if only one program is compiled.
Object files produced from
.cC C C++
programs must be linked before being executed.
.iM
.TP
.B \-C
Prevent the preprocessor from stripping C-style comments (see
.BR cpp (1)
for details).
.iM
.if \n(CC \{            \" C++ translator inline function
.TP
\fB+d\fR
Do not expand inline functions.
.iM
\}
.TP
\fB\-D\fI name=def
.PD 0
.TP
\fB\-D\fI name
Define
.I name
to the preprocessor, as if by
.BR #define .
See
.BR cpp (1)
for details.
.iM
.PD
.TP
\fB\-e\fI sym
Tell the link editor to set entry point to that of
.IR sym .
.if \n(CC \{\c          \" C++ section
If the symbol is the name of a function with C++ linkage, it must be specified
in its unmangled C++ form, with argument types exactly as the \fBnm++\fP utility
would display them (for example, \fB"foo::bar(char*)"\fP).
\}
See
.BR ld (1)
for more details.
.iM
.if \n(CC \{            \" C++ optimize option.
.TP
\fB+e{ \fB0 \fR| \fB1 \fR}
Optimize a program to use less space by ensuring that only one virtual function
table is generated per class.  By default, the virtual function table is static
and defined.  With \fB+e0\fR, the table is external and declared (that is,
uninitialized).  With \fB+e1\fR, the table is external and defined (that is,
initialized).
.IP
\fBNOTE:\fR  This option is obsolete.  Because \fBcfront\fR
automatically optimizes virtual function table
generation, it almost always ignores the \fB+e\fR
option.
.iM
\}
.TP
.B \-E
Run only
.ie !\n(CC .BR cpp (1)
.el .BR c++cpp
on the named
.ie !\n(CC .B C
.el .B C++
or assembly files,
and send the result to the standard output.
.iM
.if \n(CC \{            \" C++ options
.TP
\fB\-F\fR
Translate each C++ file to C and send the output to standard output instead of
to a source file.
.iM
.TP
\fB\-Fc\fR
Same as the combination of \fB\-F\fP and \fB\+L\fP.
.iM
\}
.TP
.B \-g
Cause the compiler to generate information for
the symbolic debugger.  Equivalent to \fB\-q debug:full\fR.
.iM
.if \n(CC \{            \" C++ options
.TP
\fB\-H\fR
Tell \fBc++cpp\fR to display to \fBstderr\fR the names of all \fB#include\fR files.
.iM
.TP
\fB\+i\fR
Leave an intermediate C file named with a \fB..c\fR (instead of \fB.i\fR) suffix in the
working directory for each C++ source file.  By default, intermediate C files
are deleted.
.iM
\}
.TP
\fB\-I\fI dir
Change the algorithm used by the preprocessor for
finding include files to also search in directory
.IR dir .
See
.BR cpp (1)
for details.
.iM
.TP
.BI \-l x
Cause the link editor to search the library
.BI lib x .so
or
.BI lib x .a
in an attempt to resolve currently unresolved external references.  See
.SM
DESCRIPTION
above for more information about using this option.
.iM
.TP
\fB\-L\fIdir
Change the algorithm used by the link editor to search for
.BI lib x .so
or
.BI lib x .a .
The
.B \-L
option causes
.cC \fBcc\fP \fBCC\fP
to search in
.IR dir
before searching in the default locations.
See
.BR ld (1)
for details.
.iM
.if \n(CC \{            \" C++ options
.TP
\fB\+L\fR
Generate source line number information using the format \fB#line %d\fR instead of
the format \fB# %d\fR.  This is the default unless \fB\-F\fR is specified.
.iM
.TP
\fB\+m\fR
Revert to the original AT&T mode of code generation.
.iM
\}
.TP
\fB\-o\fI outfile
Name the binary output file from the link editor
.IR outfile .
The default name is
.BR a.out .
.iM
.TP
.B \-O
Invoke the optimizer with high level optimization.
Equivalent to \fB\-q opt:high\fR.
.iM
.TP
.B \-p
Arrange for the compiler to produce code that
counts the number of times each routine is called.
Also, if link editing takes place, replace the standard startup
routine by one that automatically calls
.BR monitor (3C)
at the start and arranges to write out a
.B mon.out
file at normal termination of execution of the object program.
An execution profile can then be generated by use of
.cC \fBprof\fP(1). \fBprof++\fP(1).
.iM
.TP
.B \-pg
Prepare object files for profiling with
.cC \fBgprof\fP \fBgprof++\fP
(see
.cC \fBgprof\fP(1)). \fBgprof++\fP(1)).
.iM
.if \n(CC \{            \" C++ option +p
.TP
\fB\+p\fR
Use "pure" C++.  The \fB+p\fR option tells the translator not to use any anachronistic
constructs as defined in "The Annotated C++ Reference Manual" and to generate an
error for code that uses such constructs.  By default, \fBcfront\fR issues
warnings (not errors) for anachronistic constructs used in C++ source files.  The
\fB+p\fR option also causes warnings to be generated for the use of language
extensions.
.iM
\}
.TP
.B \-P
Run only
.ie !\n(CC .BR cpp (1)
.el .BR c++cpp
on the named
.cC C C++
files and leave the result
on corresponding files suffixed
.BR .i .
The
.B \-P
option is also passed along to
.ie !\n(CC .BR cpp (1).
.el .BR c++cpp .
.iM
.TP
.B \-r
Link editor option to retain relocation information.
See
.BR ld (1)
for more details.
.iM
.\"  ------------ -q  -------------------
.TP
\fB \-q \fIoption-name\fR | \fIoption-name\fB:\fIoption-arguments\fR | \fIoption-name\fB=\fIoption-arguments\fR
Introduce standard OSF/1 options under a single letter.
The arguments to \fB\-q\fP are \fIoption-name\fPs, some of which have additional \fIoption-arguments\fP.
These arguments are separated from the \fIoption-name\fP with either a \fB:\fR or a \fB=\fR
character;  the two characters are treated equivalently.
.PD
Valid \fIoption-name\fP arguments to the \fB\-q\fR option are as follows:
.RS
.\"  ------------ bit_default
.TP
.B "\fBbit_default:\fR{ \fBsigned\fR | \fBunsigned \fR}
Specify the sign of plain bit-fields (i.e., those for which neither
\fBsigned\fP or \fBunsigned\fP has been specified in the source program).
The default is \fBunsigned\fR.  At HP OSF/1 TR, the \fBsigned\fP
argument is not supported.
.\"  ------------ cg_fastmath
.TP
.B cg_fastmath
Specify the use of built-in, fast versions of math routines.
(These may not give standard-conforming behavior in error situations.)
.iM
.TP
.B no_cg_fastmath
Specify the use of standard library versions for math functions.  (Default)
.iM
.\"  ------------ cg_faststring
.TP
.B cg_faststring
Specify the use of built-in, fast versions of string manipulation
routines.
.iM
.TP
.B no_cg_faststring
Specify the use of standard library versions of string manipulation
routines.  (Default)
.iM
.\".TP
.\".B cg_fp_assoc
.\"This option enables the optimizer to associate floats over addition
.\"and multiplication; the default behavior is to not provide this
.\"functionality.
.\".TP
.\".B cg_fp_IEEE
.\"Tell the compiler that conformance to IEEE Standard 754 in floating
.\"point calculations is desired.  What does this do for \fIus\fR???
.\"  ------------ cg_null_fetch
.TP
.B cg_null_fetch
Allow the program to fetch values from null pointers without error;
the value returned will be zero.
.iM
.TP
.B no_cg_null_fetch
Do not allow dereferencing of null pointers.  A memory fault will generally
occur at run time.  (Default)
.\".TP
.\"\fBcg_shrink\fB
.\"This option forces a store/load (i.e. rounding) of all floating
.\"point operands; this is done in order to preserve equality among
.\"floating point expressions.
.ig \" suppress volatile stuff for Acorn
.TP
.B cg_volatile_ptrs
Specify that the compiler is to consider all pointer variables to
have been declared with the type qualifier \fIvolatile\fR.
..  \" end ignore
.\"  ------------ cg_writable_strings
.TP
.B cg_writable_strings
Specify to the compiler that string literals are to be placed into
writable memory.  Separate copies are created for each literal, even
when several literals have the same value.  (Default)
.iM
.TP
.B no_cg_writable_strings
Specify that the compiler can optimize space by creating only one
instance of each string literal value, and place them into read-only memory.
(At HP OSF/1 TR, this option is not supported.)
.iM
.\"  ------------ char_default
.TP
\fBchar_default:\fR{ \fBsigned\fR | \fBunsigned \fR}
Specify the sign of the plain \fBchar\fP type.  The default is
\fBsigned\fR.  At HP OSF/1 TR,
the \fBunsigned\fR argument is not supported.
.iM (none)
.\"  ------------ debug
.TP
.B "debug:\fR{ \fBmin\fR |\fB full\fR |\fB none \fR}
Control generation of debug information.
.B min
(default) causes only minimal debug information is to be generated.
.B full
causes full symbolic run-time debug information to be
generated (same as
.B -g\c
).
.B none
causes no debug information to be generated.
.iM
.if !\n(CC \{           \" Not supported by C++
.\"  ------------ fail_level
.TP
.B "fail_level:\fR{ \fB0\fR | \fB2\fR | \fB4\fR | \fB6\fR | \fB8\fR }
Consider the compilation considered successful only if there are no
diagnostics at the specified level or lower (more serious).
The levels represent:
.RS 10
.PD 0
.TP 5
.B 0
Fatal/serious error
.TP 5
.B 2
Recoverable error
.TP 5
.B 4
Serious warning
.TP 5
.B 6
Moderate warning
.TP 5
.B 8
Informational messages
.RE
.IP
The default level is \fB2\fR.
.iM
.PD
\}
.\"  ------------ file_prefix
.TP
\fBfile_prefix:\fIpath\fR
Tell the compiler that the prefix \fIpath\fR is to be placed in
front of the standard path names used by the compilation system.
This option applies to all the components in the compilation process.
./" This option applies to all files in the compilation process: header
./"files, compiler, preprocessor, link editor, libraries.
.iM
.\"  ------------ from_env
.TP
\fBfrom_env:\fIenvar\fR
Read options from the environment variable
.IR envar .
Resume options on command line at end of environment variable.
.\"  ------------ from_file
.TP
\fBfrom_file:\fIfilename\fR
Read options from
.IR filename .
Resume options on command line at end-of-file.
.\"  ------------ help
.TP
.B help
Provide an online summary of the
.cC \fBcc\fR \fBCC\fR
options.
.\"  ------------ host_is_target
.TP
.B host_is_target
Specify that the host configuration is the one to which
compilation should be tailored.  (Default)
.IP
This option is defined in terms of setting other options.  It
is position-dependent, with processing occurring left to right on the
command line.  The actions of \fB\-q host_is_target\fP are to set
\fB\-q sl_host\fP
and
\fB\-q target:PA1.1\fP (the current machine).
.iM
.\"  ------------ no_host_is_target
.TP
.B no_host_is_target
Specify that the host configuration \fInot\fP affect decisions
in the compilation process.
.IP
This option is defined in terms of setting other options.  It
is position-dependent, with processing occurring left to right on the
command line.  The action of \fB\-q no_host_is_target\fP is to set
\fB\-q no_sl_host\fP.
.iM
.\"  ------------ incl_private
.TP
.B incl_private:\fIpath\fR
Similar to the \fB\-I\fR option, but use only the supplied \fIpath\fP to
search for header files specified with double quotes.
For example,
.RS 18
\fB#include "file.h"
.RE
.\" .IP   \" supported as of 10/1/91 acc. to Curt W.
.\" (This option is not yet supported in the Acorn compiler; it will be
.\" interpreted as if you had written \fB\-I\fP).
.iM
.\"  ------------ incl_sys
.TP
.B incl_sys:\fIpath\fR
Similar to the \fB\-I\fR option, but use only the supplied path to
search for header files specified with brackets.  For example,
.RS 18
\fB#include <file.h>
.RE
.\" .IP    \" supported as of 10/1/91 acc. to Curt W.
.\" (This option is not yet supported in the Acorn compiler; it will be
.\" interpreted as if you had written \fB\-I\fP).
.iM
.\"  ------------ incl_std
.TP
.B incl_std
Search for header files in standard system directories and
in the directory of the file
containing the \fB#include\fR directive.  (Default)
.TP
.B no_incl_std
Do not search for header files in standard system directories
or in the directory of the file
containing the \fB#include\fR directive.
Search only those directories specified by the
.B \-I
option.
.iM
.if !\n(CC \{           \" Not supported by C++
.\" ------------ lang_level
.TP
\fBlang_level:\fR{ \fBansi\fR |\fB ansi_extend\fR |\fB classic \fR}
Tell the compiler which dialect of the C language to accept.
.B ansi
selects the C language as defined by ANSI.
.B ansi_extend
(default) selects the ANSI C language, with the addition of certain common extensions.
Extensions include the use of the dollar sign ($) in identifiers, sized enums,
and multiple-definition points for uninitialized external static data.
See the "HP OSF/1 TR C Programmer's Guide" for details.
.B classic
selects the traditional K&R C language.
.iM
.\"  ------------ lang_ext
.TP
\fBlang_ext:\fR{ \fBnone\fR | \fBsome:\fIlist\fR | \fBexcept:\fIlist\fR }
Enable selected language extensions.  Invalid if \fB\-q lang_level:ansi\fR
is specified.  For HP OSF/1 TR, this option is ignored.  It is provided
for compatibility.
.\" QQQQQQQQ  do we need "except" in this option?   /drl
.iM
.\"  ------------ list
.TP
\fBlist:\fR{ \fBnone\fR | \fBincludes\fR | \fBincl_dep\fR | \fBprepro\fR | \fBasm \fR}
The option-arguments above may have one or both of the following modifiers:
.RS 18
\fB,file=\fIpathname\fR | \fB,only\fR
.RE
.IP
This is the general option to control listing files.
.BR none
(default) turns off any listings that might be specified so far.
.BR includes
prints information about include files seen.  By default, this
goes to \fBstderr\fR.
.BR incl_dep
prints information about include dependencies, suitable for use
with various tools such as \fBmake\fR(1).  By default, the output goes
to \fIfile\fR.\fBd\fR.
.BR prepro
produces a preprocessed file listing (in the format of the \fB\-E\fR
option).  By default, the output goes to \fIfile\fR.\fBi\fR.  This listing is
captured during compilation; any other options which affect the
preprocessor will also affect this listing.
.BR asm
produces an assembly-language-like output (in the format of the
\fB\-S\fR option).  By default, the output
goes to \fIfile\fR.\fBs\fR.
It should be noted that the
.B \-o
option does not affect the base name of the listing file.
.PD 0
The
.B file
modifier can be used to specify the \fIpathname\fR of the
listing file to be
different from the default file.  The
.B only
modifier can be used to indicate that compilation need go no further
than that necessary to produce the listing file.
.PD
.iM
\}                      \" END
.\"  ------------ msg_level
.TP
.B "msg_level:\fR{ \fB0\fR | \fB2\fR | \fB4\fR | \fB6\fR | \fB8\fR }
Specify the level of messages that are to be reported.
The levels represent:
.RS 10
.PD 0
.TP 5
.B 0
Fatal/serious error
.if \n(CC (sends \fB\-w\fP to the C++ translator)
.TP 5
.B 2
Recoverable error
.if \n(CC (same as \fB\-w\fP)
.TP 5
.B 4
Serious warning
.TP 5
.B 6
Moderate warning
.if \n(CC (sends \fB+w\fP to the C++ translator)
.TP 5
.B 8
Informational messages
.if \n(CC (same as \fB+w\fP)
.RE
.IP
The default level is \fB4\fR.
.iM
.PD
.\"  ------------ negate
.TP
\fBnegate:\fIoption\fR
Turn off the option specified, in order to undo any (possible)
prior setting of
.IR option.
For example,
.B \-q negate:c
causes the link edit phase to take place.
.B negate
applies only to top-level options (i.e., those not under \fB\-A\fP or \fB\-q\fP);
it also does not apply to options that take arguments.
.iM
.\"  ------------ opt
.TP
\fBopt:\fR{ \fBnone\fR | \fBmoderate\fR | \fBhigh\fR | \fBultra\fR | \fBdebug\fR}
Select optimization level.
\fBnone\fR indicates no optimization (fastest compiles);
\fBmoderate\fR requests optimizations that require only moderate increases in compile time;
\fBhigh\fR requests that the compiler work fairly hard at producing an optimal program;
\fBultra\fP requests the very best optimization possible, even at considerable increase
in compile time and object program size.
\fBdebug\fP requests that the compiler go out of its way, if necessary, to produce
object code that is easy for the debugger to comprehend, even if this involves an increase in compile time.
The default level is \fBnone\fR.
.iM
.\"  ------------ output_type  (find another name!!)
.TP
\fBoutput_type:\fR{ \fBnormal\fR | \fBshlib \fR}
Tell the compiler the desired use of the objects being compiled.
\fBnormal\fR indicates that the result of this compilation will be used for normal
programs (default);
\fBshlib\fR indicates that a shared object library is being built.  If you specify
\fB\-q output_type:shlib\fR, you must also specify \fB\-q sl_export\fR.
.iM
.if !\n(CC \{           \" C only
.\"  ------------ size_wchar_t
.TP
\fBsize_wchar_t:\fR{ \fB8\fR | \fB16\fR | \fB32\fR | \fBnone\fR }
Specify the size of the \fBwchar_t\fR type.  This affects both the
typedef and the interpretation of the \fBL\fP prefix for character
string constants.  \fBnone\fR specifies
that the use of \fBwchar_t\fR is not allowed, and suppresses the
typedef.
.iM
\}
.\"  ------------ sl_enable
.TP
.B sl_enable
Enable the use of shared libraries.
The compiler will produce code to link to data and code defined by shared libraries.
It uses information provided by \fB\-q sl_host\fP, \fB\-q sl_import\fP,
\fB\-l\fP, and \fB\-L\fP to determine which symbols are so defined.
With \fBsl_enable\fP set, the link editor will accept \fBlib\fP\fIx\fP\fB.so\fP files
when processing \fB\-l\fP directives.
.if !\n(CC (Default)
.iM
.\"  ------------ no_sl_enable
.TP
.B no_sl_enable
Disable the use of shared libraries.  The compiler does not receive \fB\-l\fP and \fB\-L\fP
information, nor generate shared library linkage.  The link editor will search only for
\fBlib\fP\fIx\fP\fB.a\fP files when processing \fB\-l\fP directives.
.if \n(CC (Default)
.iM
.\"  ------------ sl_host
.TP
.B sl_host
Cause the compiler to look for symbol definitions in the Known Package Table on the
current host machine, to determine which external symbols should be compiled
with shared library linkage.  (This table holds the definitions for the
standard shared libraries installed during system initialization.)
(Default)  (\fB\-q sl_host\fP is set by \fB\-q host_is_target\fP.)
.iM
.\"  ------------ no_sl_host
.TP
.B no_sl_host
Inhibit the compiler from looking at the information from shared libraries
installed on the current host.  Only shared library definitions found via
explicit options (\fBsl_import\fP, \fB\-l\fP) will be used in determining which
external symbols should have shared library linkage.
(\fB\-q no_sl_host\fP is set by \fB\-q no_host_is_target\fP.)
.iM
.\"  ------------ sl_export
.TP
.B "sl_export:\fIpackage\fR:\fR{ \fBall\fR | \fBsome:\fIlist\fR }
.\"   \fBexcept:\fIlist\fR | \fBall\fR
Tell the link editor to associate a \fIpackage\fP name with a set of externally visible
symbols when creating a shared library.  If you specify \fBall\fR, all global
symbols are exported under the given package name.  If you specify \fBsome\fP,
\fIlist\fP is a comma-separated list of symbols.
.if \n(CC \{\c          \" C++ section
If the symbol is the name of a function with C++ linkage, it must be specified
in its unmangled C++ form, with argument types exactly as the \fBnm++\fP utility
would display them (i.e. \fB"foo::bar(char*)"\fP).
.iM
.\"  ------------ sl_import
.TP
.B "sl_import:\fIpackage\fR:\fR{ \fBnone\fR | \fBsome:\fIlist\fR }
.\"   \fBexcept:\fIlist\fR | \fBall\fR
Indicate to the compiler and/or link editor that external symbols indicated by the
comma-separated \fIlist\fR are defined in the shared library \fIpackage\fR.
.iM
\}
.\"  ------------ stdlib
.TP
.B stdlib
Control standard library processing by the link editor.  When \fBstdlib\fP is specified,
the link editor is directed to include the standard startup file \fB/usr/ccs/lib/crt0.o\fP, and
the link editor's library search path starts as \fB/usr/shlib /usr/lib\fP.
(Default)
.iM
.\"  ------------ no_stdlib
.TP
.B no_stdlib
Direct the link editor not to link in standard system libraries
and startup files, but to link in only those specified
by the user.  Also direct the link editor not to search standard directories
for specified libraries, but to search only directories
specified by the
.B \-L
option.
.iM
.\"  ------------ target
.TP
\fBtarget:\fIlist\fP
Specify the hardware configurations on which the program being processed
should run.  The argument is a comma-separated list; valid values are
\fBPA1.0\fP and \fBPA1.1\fP.
(Consult the release notes for your version of the compiler
for the list of currently supported values.)
.IP
This option controls two different kinds of characteristics:  absolute
requirements and tuning.  Absolute requirements include things like the particular
instruction set supported by a particular model; the resultant program will
only exploit features present in all listed targets.  Tuning
includes subtle issues like instruction timing, which may differ from model
to model; the resultant program will be optimized for best performance on
the targets listed at the beginning of the list.
.IP
\fBNOTE:\fP  For HP OSF/1 TR, the \fBPA1.0\fP models are not supported.
This option is provided to allow for upward compatibility.
.iM
.\"  ------------ verbose
.TP
\fBverbose:\fR{ \fBshow\fR |\fB time\fR |\fB dryrun\fR |\fB none \fR}
Invoke the driver in verbose mode. If
.BR show
is specified,
.SM
.ie !\n(CC .BR CCOPTS ,
.el .BR CXXOPTS ,
switches, and subprocesses are written
to
.B stderr
as the compile proceeds.  If
.BR time
is specified, the driver also shows the timing of the phases.  If
.BR dryrun
is specified, the driver shows subprocesses and switches
but does not actually perform them.
.BR none
(default) turns verbose mode off.
.iM
.TP
.\"  ------------ version
.B version
Cause each driver component to print its version number.
.RE
.iM
.\"  ------------ -s
.PD
.TP
.B \-s
Cause the output of the link editor to be stripped of symbol table
information.
See
.BR strip (1)
for more details.
The use of this option prevents the use of a symbolic debugger
on the resulting program.
See
.BR ld (1)
for more details.
.iM
.\"  ------------ -S
.TP
.B \-S
Compile the named
.cC C C++
files, and leave the
assembly language output on corresponding files suffixed
.BR .s .
.iM
.\"  ------------ -t
.TP
\fB\-t\fIc1\fR[\fIc2\fR...]\fB,\fIpathname\fR
Specify \fIpathname\fR as the alternate location for subprocess \fIc\fR.  If you
specify only one \fIc\fR and \fIpathname\fR does not end with a slash (\fB/\fR),
then \fIpathname\fR is the complete pathname of the subprocess executable file.
If you specify only one \fIc\fR and \fIpathname\fR ends with a slash (\fB/\fR),
then \fIpathname\fR is a directory containing the component with its default
name.  Otherwise, \fIpathname\fR is a directory containing the executable files
with their default names.
.IP
You can use \fBx\fR as \fIc\fR to specify all subprocesses.  In other words, the
following specifications are equivalent: \fB\-tx\fB,\fIpathname\fR and
.ie \n(CC \fB\-tpCb0mlsfP\fB,\fIpathname\fR.
.el \fB\-tpcals\fB,\fIpathname\fR.
.RS 18
.PD 0
.TP 5
.B p
Preprocessor
.ie !\n(CC .BR (/usr/ccs/lib/cpp)
.el .BR (/usr/CC/lib/c++cpp)
.if \n(CC \{            \" C++ only
.TP 5
.B C
C++ translator
.BR (/usr/CC/lib/cfront)
.TP 5
.B b
C driver
.BR (/usr/ccs/bin/c89)
\}
.TP 5
.B c
C compiler
.BR (/usr/ccs/lib/ccom)
.TP 5
.B 0
C compiler, alternate form
.BR (/usr/ccs/lib/ccom)
.if !\n(CC \{           \" C only
.TP 5
.B a
Assembler
.BR (/usr/ccs/bin/as)
\}
.if \n(CC \{            \" C++ only
.TP 5
.B m
Debugging merger tool
.BR (/usr/CC/lib/c++merge)
\}
.TP 5
.B l
Link editor
.BR (/usr/ccs/bin/ld)
.TP 5
.B s
Startup file
.BR (/usr/ccs/lib/crt0.o)
.if \n(CC \{            \" C++ only
.TP 5
.B f
C++ filter tool
.BR (/usr/CC/bin/c++filt)
.TP 5
.B P
Constructor linker
.BR (/usr/CC/lib/c++patch)
\}
.TP 5
.B x
Shorthand for all components
.ie !\n(CC .RB ( pcals );
.el .RB ( pCb0mlsfP );
implies their standard suffixes.
.RE
.PD
.\"  ------------ -U
.TP 15
\fB\-U\fI name
Remove any initial definition of
.I name
in the preprocessor.
See
.BR cpp (1)
for details.
.iM
.\"  ------------ -u
.TP
\fB\-u\fI sym
Tell the link editor to enter
.IR sym
as an undefined symbol.
.if \n(CC \{\c          \" C++ section
If the symbol is the name of a function with C++ linkage, it must be specified
in its mangled C++ form, with argument types exactly as the \fBnm++\fP utility
would display them.
\}\c
See
.BR ld (1)
for more details.
.iM
.if \n(CC \{            \" C++ warning options
.TP
\fB\-w\fR
Suppress warnings from \fBcfront\fR and \fBcc\fR (same as \fB\-q msg_level:2\fR).
.iM
.TP
\fB\+w\fR
Issue warnings (same as \fB\-q msg_level:8\fR).  Tells \fBcfront\fR and \fBcc\fR
to issue warnings about all questionable constructs, not only about constructs
that are most likely problems.
.iM
\}                      \" End C++ warning options
.\"  ------------ -W
.TP
\fB\-W\fIz\fB,\fIarg1\fR[\fB,\fIarg2\fR...]
Pass the argument(s)
.I argi
to subprocess
.IR z .
.B \-W
allows additional, implementation-specific
options to be passed on to the compiler components.
For example,
.IP
.ft B
        \-Wc,\-x
.ft R
.IP
causes the driver to pass
.B \-x
to the compiler phase.
.I z
can assume one of the following values:
.RS 18
.PD 0
.TP 5
.B d
Driver
.TP 5
.B p
Preprocessor
.if \n(CC \{            \" C++ only
.TP 5
.B C
C++ translator
.TP 5
.B b
C driver
\}
.TP 5
.B c
Compiler
.TP 5
.B 0
Compiler (alternate form)
.if \n(CC \{            \" C++ only
.TP 5
.B m
C++ debugging merger tool
\}
.if !\n(CC \{           \" C only
.TP 5
.B a
Assembler
\}
.TP 5
.B l
Link editor
.if \n(CC \{            \" C++ only
.TP 5
.B f
C++ filter tool
.TP 5
.B P
C++ constructor linker
\}
.RE
.PD
.IP
Certain options are available to the driver via the \fBd\fR
subprocess argument:
.RS
.TP
\fBcommand_char:\fIletter\fR
Use \fI\-letter\fR instead of the default \fB\-q\fR to introduce
standard OSF/1 options on the command line.  This letter must not be
the same as another defined option.
.TP
\fBvendor_char:\fIletter\fR
Use \fI\-letter\fR instead of the default \fB\-A\fR to introduce
options specific to HP OSF/1 TR on the command line.  This letter must not be
the same as another defined option.
.ie \n(CC \{            \" C++ only
.RE
.IP
\fBWARNING:\fP Using \fB\-W\fR to pass options to \fBcc\fR or \fBld\fR may
produce unexpected results.
\}
.el .RE
.PD
.if \n(CC \{            \" C++ options
.TP
\fB\+x\fIfilename\fR
Use the size/alignment specifications in \fIfilename\fR.  Each line in the file
contains three fields: a type name, the size (in bytes), and the alignment (in
bytes).
.TP
\fB\-.\fIsuffix \fR{ \fB+i \fR| { \fB\-E \fR| \fB\-F \fR| \fB\-Fc \fR} }
In conjunction with \fB+i\fR, \fB\-.\fIsuffix\fR changes the suffix of the output C file
from \fB..c\fR to \fB.\fIsuffix\fR.  In conjunction with \fB\-E\fR, \fB\-F\fR, or
\fB\-Fc\fR, \fB\-.\fIsuffix\fR sends output to a file in the working directory with the
base name of the source file and \fB.\fIsuffix\fR instead of to standard output.
\}
.PP 0
Any other options encountered generate a warning to
standard error.
.PP
Other arguments are taken to be
.cC C-compatible C++-compatible
object programs, typically produced by an earlier
.cC \fBcc\fP \fBCC\fP
run, or perhaps libraries of
.cC C-compatible C++-compatible
routines.
These programs, together with the results of any
compilations specified, are linked (in the order
given) to produce an executable program with the name
.BR a.out .
.SH EXTERNAL INFLUENCES
.SS Environment Variables
.SM
.B TMPDIR
determines the directory in which temporary files are created.
By default
.BR /tmp
is used as the directory for creating temporary files.
.if \n(CC \{            \" C++ only
.P
.SM
.B CCROOTDIR
specifies the directory in which all subprocess executables are located.
.P
.SM
.B CCLIBDIR
specifies the directory in which to find the standard C++ library
(\fBlibC.a\fR).
\}
.P
.SM
.cC \fBCCOPTS\fP  \fBCXXOPTS\fP
specifies options to be passed to
.cC \fBcc\fP.  \fBCC\fP.
(See the
.SM
DESCRIPTION
section above.)
.SH DIAGNOSTICS
The diagnostics produced by
.cC \fBcc\fP  \fBCC\fP
itself are intended to be self-explanatory.
Occasionally, messages may be produced by the preprocessor,
.if \n(CC C compiler,
assembler or link editor.
.PP
If any errors occur before
.cC \fBcc\fP  \fBCC\fP
is completed, a non-zero value is returned.
Otherwise, zero is returned.
.SH EXAMPLES
The following compiles the
.cC C C++
file
.ie \n(CC .BR prog.C , \" C++ sources end with .C (in examples at least).
.el .BR prog.c ,
creates a
.B prog.o
file, and
then invokes the link editor
.BR ld (1)
to link
.BR prog.o " and " procedure.o
with all the C startup routines in
.B /usr/lib/crt0.o
and library routines from the
.cC C C++
library
.if !\n(CC \{\c         \" C libraries.
.BR libc.so
or
.BR libc.a .
\}\c
.if \n(CC \{\c          \" C++ libraries
.BR libC.so
or
.BR libC.a .
\}\c
The resulting executable
program is output in
.BR prog :
.IP
.ft B
.cC cc CC
\-o prog
.cC prog.c prog.C
procedure.o
.ft R
.SH WARNINGS
Options not recognized by
.cC \fBcc\fP \fBCC\fP
are not passed on to the link editor.
(The option \fB\-Wl,\fIarg\fR
can be used to pass any option to the link editor exclusively.)
.\"  WHY do we want to include the following thing here ... seems
.\"  relevant to nothing that's come before!   /drl
.PP
By default, the return value from a
.cC C C++
program is completely random.
The only two guaranteed ways to return a specific value
are to explicitly call
.BR exit (2)
or to leave the function
.BR main(\|)
with a
.RB ` return
.IR expression ;'
construct.
.if !\n(CC \{           \" C files
.SH FILES
.PD 0
.TP 30
.IR file .c
Input file
.TP
.IR file .i
Preprocessed C file
.TP
.IR file .o
Object file
.TP
a.out
Linked output
.TP
/tmp/ctm\(**
Default temporary files
.TP
/usr/tmp/ctm\(**
Default temporary files
.TP
/usr/ccs/lib/ccom
C compiler
.TP
/usr/ccs/lib/cpp.trad
Traditional K&R C preprocessor
.TP
/usr/ccs/lib/cpp.ansi
ANSI C preprocessor
.TP
/usr/ccs/bin/as
Assembler,
.BR as (1)
.TP
/usr/ccs/bin/ld
Link editor,
.BR ld (1)
.TP
/usr/ccs/lib/crt0.o
Run-time startup
.TP
/usr/ccs/lib/mcrt0.o
Startup for profiling via \fBprof\fR(1)
.TP
/usr/ccs/lib/gcrt0.o
Startup for profiling via \fBgprof\fR(1)
.TP
/usr/ccs/lib/libc.a
Standard C library (archive version)
.\" , see
.\" .I HP-UX Reference
.\" Section (3).
.\" we don't have a substitute for this -kh
.TP
/usr/include
Standard directory for
.B #include
files\}                 \" End of C files
.if \n(CC \{            \" C++ files
.SH FILES
.PD 0
.TP 30
.IR file .C
Input file
.TP
.IR file .i
Preprocessed C++ file
.TP
.IR file .o
Object file
.TP
a.out
Linked output
.TP
/bin/CC
C++ driver (link to \fB/usr/CC/bin/CC\fP)
.TP
/usr/CC/lib/c++cpp
C++ preprocessor
.TP
/usr/CC/lib/cfront
C++ translator
.TP
/usr/CC/lib/c++patch
C++ constructor linker
.TP
/usr/CC/lib/c++merge
C++ debug translator
.TP
/usr/CC/bin/c++filt
Error message decoder
.TP
/usr/CC/lib/libC.a
C++ run-time library (contains streams library)
.TP
/usr/CC/shlib/libC.so
C++ shared run-time library (contains streams library)
.TP
/usr/CC/lib/libcodelibs.a
HP Codelibs library
.TP
/usr/CC/lib/libcomplex.a
C++ complex mathematics library
.TP
/usr/CC/lib/libdemangle.a
Provides the demangle() function
.TP
/usr/CC/lib/libOstream.a
Previous version of C++ streams library
.TP
/usr/include/CC
Standard directory for
.B #include
files (link to \fB/usr/CC/include\fP)
.TP
/usr/include
Standard directory for
.B #include
files\}                 \" End of C++ files
.PD
.SH "COMPATIBILITY WITH OSF/1"
This command is provided with the HP OSF/1 Technology Release.  It may
not be provided on other implementations of OSF/1.
.SH SEE ALSO
.if \n(CC cc(1),
as(1), cpp(1), ld(1), exit(2), end(5).
.ie !\n(CC \{           \" C manuals
.PP
B. W. Kernighan and D. M. Ritchie,
.IR "The C Programming Language"
(Second Edition), Prentice-Hall, 1988.
.PP
.IR "American National Standard for Information Systems \- Programming Language C" ,
ANS X3.159-1989
\}
.el \{                  \" C++ manuals
.PP
"HP OSF/1 TR C++ Programmer's Guide"
.PP
"HP OSF/1 TR C Programmer's Guide"
.PP
"AT&T C++ Language System Release 2.1"
\}
.if !\n(CC \{           \" C standards
.SH "STANDARDS CONFORMANCE"
.BR cc ": SVID2, XPG2, XPG3"
.\" .RE
.br
.BR c89 ": POSIX 1003.2, Draft 10"
\}
.\"
.\" index       \fIcc\fR \- C compiler   \fBcc(1)\fR
.\" index       C compiler       \fBcc(1)\fR
.\" index       compilers: C compiler    \fBcc(1)\fR
.\"
.\" toc \fBcc(1)\fR:\0\0\fIcc\fR         C compiler
.\"
.\" links       cc.1 c89.1
.\"
.\" fileset_database    cc.1 C-MAN
.\" .SH VERSION
.\" Man page version of $Date: 91/11/22 13:28:05 $,  $Revision: 1.22 $

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026