CC(1C++)

NAME
CC - C++ translator (``cfront'')

SYNOPSIS
CC [ options ] file ...

DESCRIPTION
CC is the AT&T C++ compiler. The command uses cpp(1) for preprocessing, cfront for syntax and type checking, and cc(1) for code generation.

CC takes arguments ending in .c, .C or .i to be C++ source files. .i files are presumed to be the output of cpp(1). Both .s and .o files are also accepted by the CC command and passed to cc(1).

For each C++ source file, CC creates a temporary file, file.c, in /usr/tmp, containing the generated C file for compilation with cc(1). The -F~-.suffix option saves a copy of this file in the current directory with the name file.suffix. The +i option saves a copy of the generated C code (minus #line directives) in the current directory with the name file..c.

In addition to the options described below, CC accepts other options and passes them on to the C compilation system tools. See cpp(1) for preprocessor options, cc(1) for C compiler options, ld(1) for link editor options, and as(1) for assembler options.

The following options apply to the C++-specific parts of the compilation process:

-E  Run only cpp(1) on the C++ source files and send the result to standard output.

-F  Run only cpp(1) and cfront on the C++ source files, and send the result to standard output. The output contains #line directives.

-.suffix
    When used in combination with -E or -F , place the output from each input file in a file with the specified suffix in the current directory.

-CU Uses a previously compiled ctdt.o file, if it exists, and saves it for future reuse. The munch program is not run, which makes the links faster. Alternatively, set the USECTDT=YES environment variable.

+a[01]
    The C++ compiler can generate either ANSI C-conforming or K&R C-style declarations. The +a option specifies which style of declarations to produce. The default, +a0, causes the compiler to produce K&R C-style declarations. The +a1 option causes the compiler to produce ANSI C-conforming declarations.

+d  Do not inline-expand functions declared inline.

+e[01]
    Only to be used on classes for which virtual functions are present, and all the virtual functions are either defined as inline or pure. In this circumstance, this option optimizes a program to use less space by ensuring that only one virtual table per class is generated. +e1 causes virtual tables to be external and defined. +e0 causes virtual tables to be external but only declared. This option is ignored for any class that contains an out-of-line virtual function.

+i  Leave the intermediate ..c files in the current directory during the compilation process. These files do not contain any preprocessing directives, although the files passed to the C compiler do. When templates are used, it causes the instantiation system to leave ..c files in the repository.

+p  Disallow all anachronistic constructs. Ordinarily the translator warns about anachronistic constructs; under +p (for ``pure''), the translator will not compile code containing anachronistic constructs. See the AT&T C++ Language System Product Reference Manual for a list of anachronisms.

+w  Warn about constructs that are likely to be mistakes, be nonportable, or be inefficient. Without the +w option, the compiler issues warnings only about constructs that are almost certainly errors.

+xfile
    Read a file of size and alignments created by compiling and executing szal.c. The form of the created file is identical to the entries in size.h. This option is useful for cross compilations and for porting the translator. See the AT&T C++ Language System Release Release Notes for more information.

The template instantiation system adds several options to CC. These are specified on the CC line or by setting the environment variable PTOPTS. For example, to permanently enable verbose mode, you would say:
export PTOPTS=-ptv (for SysV)
setenv PTOPTS -ptv (for BSD)

-pta
    Instantiate a whole template class rather than only those members that are needed.

-ptn
    Change the default instantiation behavior for one-file programs to that of larger programs, where instantiation is broken out separately and the repository updated. One-file programs normally have instantiation optimized so that instantiation is done into the application object itself.

-ptrpathname
    Specify a repository, with ./ptrepository the default. If several repositories are given, only the first is writeable, and the default repository is ignored unless explicitly named.

-pts
    Split instantiations into separate object files, with one function per object (including overloaded functions), and all class static data and virtual functions grouped into a single object.

-ptt
    NOTE: This option is obsolete in Release 3.0.1 and later. In Release 3.0, alter dependency checking. Rather than using checksums, timestamps of the header and object files are compared. For each header included in an instantiation file, the first occurrence of the header is found on the -I path, and the time stamp compared to that of the object file. Reinstantiation occurs if any header was modified later than the object file. This facility is like make except that the timestamps of nested include files are not checked.

-ptv
    Turn on verbose or verify mode, which displays each phase of instantiation as it occurs, together with the elapsed time in seconds that phase took to complete. Use of this option is recommended if you are new to templates. With verbose mode, the reason why an instantiation is done and the exact CC command used are displayed.

In release 3.0, -pts and -pta cannot be used together, that is, -pts can only be used to split up needed functions rather than all functions.

The preprocessor directives -I and -D work as they normally do, but must also be specified at link time, to pick up the various template and application type header files.

ENVIRONMENT
The following are some of the user-settable environment variables: ccC C compiler (default: cc)
cfrontC
    cfront (default: CCROOTDIR/cfront)
cppC
    C preprocessor (default: /lib/cpp)

FILES
file.[Cc] C++ source file
file..c
    optional cfront output
file.i
    C++ source after preprocessing
file.s
    assembly language file
file.o
    object file
a.out
    linked output
/lib/cpp
    C preprocessor (see cpp(1))
/bin/cc
    C compiler
/lib/libc.a
    standard C library
CCROOTDIR/CC
    C++ driver shell script
CCROOTDIR/cfront
    C++-to-C translator
CCROOTDIR/patch or munch
    post-link editor
CCROOTDIR/c++filt
    name demangler for diagnostic messages
CCLIBDIR/libC.a
    C++ standard library
CCLIBDIR/libtask.a
    C++ coroutine library
CCLIBDIR/libcomplex.a
    C++ complex arithmetic library
I   colon-separated list of standard directories for #include files

The usual locations for the standard directories are as follows: CCROOTDIR /usr/bin
CCLIBDIR
    /usr/lib
I   /usr/include/CC

SEE ALSO
cpp(1), cc(1), as(1), ld(1).
Stan Lippman. C++ Primer, Second Edition Addison-Wesley 1991.
B. W. Kernighan and D. M. Ritchie. The C Programming Language, Prentice-Hall 1988.
Bjarne Stroustrup. The C++ Programming Language, Second Edition Addison-Wesley, 1991.

DIAGNOSTICS
The diagnostics produced by CC itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or link editor.