DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

CC(CP)


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

Syntax

CC [ options ] file ...

Description

CC is the C++ compiler. The command uses an internal ANSI C preprocessor for preprocessing, cfront for syntax and type checking, and cc(CP) for code generation and linking.

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

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

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


-ec xxx
Escape option to pass options to the C compiler. For example:

CC -ec xxx -ec yyy ...

will pass ``xxx yyy'' to the C compiler.


-el xxx
Escape option to pass options to the linker.

-gdem
Unmangle struct member and local variable names except where ambiguous.

-gdump
Dump out structs in C output even if not used. This feature is no longer automatically enabled by -g. -gdump imposes a performance penalty.

-ispace
Decrease inline cutoff (less inlining will be done). This will in general decrease program speed but make the program smaller. Inlining of very small inline functions will continue to be done.

-ispeed
Increase inline cutoff (more inlining will be done). This will in general increase program speed at the expense of increased space.

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

-F
Run only cpp. 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.

-g, -dbx, -dbxC
Generate additional information for the use of dbXtra (sdb may be used with some difficulty) for source-level debugging. Some code optimizations are not performed. The use of -dbx instead of -g causes an extra file to be produced allowing enhanced C++ debugging; this file passes information about classes and other C++ constructs to dbXtra. The -dbxC option allows enhanced debugging and examination of both the C++ and generated C source using dbXtra. Use of these options also passes -g to the C compiler. The -dbx and -dbxC options do not disable inlining. If you wish to debug inlined functions, you must explicitly turn inlining off using the +d option.

+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 defined either 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 C++ 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 Development System Release and Installation Notes for more information.

+.suffix
Informs the C++ compiler that files ending with the specified suffix are C++ files.

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 Bourne shell)
setenv PTOPTS -ptv (for C shell)


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

-ptdpathname
Dump list of instantiation objects to a file if any were recompiled or the file does not exist. Also bypasses actual link step. Can be used with -pti in makefiles of the form:
appl:	appl.o ilist
	CC -pti -o appl `cat ilist` appl.o

appl.o:	appl.c Vector.h A.h C.h
	CC -c appl.c

ilist:	always
	CC -ptdilist appl.o

always:

-pth
Force repository names to be less than 14 characters even if the OS supports long names. This is useful in building archive libraries.

-pti
Ignore ptlink pass.

-ptk
Force ptlink to continue trying to instantiate even after instantiation errors on previous template classes.

-ptmpathname
Have ptlink dump out a ``link map'' showing what actions the link simulator took.

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

-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.1, -pts and -pta cannot be used together, that is, -pts can be used only 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.

Diagnostics

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

Environment

The following are some of the user-settable environment variables:

ccC
C compiler (default: cc)

cfrontC
cfront (default: CCROOTDIR/cfront)

cppC
ANSI C preprocessor (default: CCROOTDIR/cpp)

Files


file.C
C++ source file

file..c
optional cfront output

file.i
C++ source after preprocessing

file.s
assembly language file

file.o
object file

file..dbx
dbXtra debug information

a.out
linked output

/bin/cc
C compiler

/lib/libc.a
standard C library

/usr/bin/CC
C++ driver shell script

CCROOTDIR/cpp
ANSI C preprocessor

CCROOTDIR/cfront
C++-to-C translator

CCROOTDIR/patch or munch
post-link editor

CCROOTDIR/c++filt
name demangler for diagnostic messages

CCROOTDIR/ptcomp and ptlink
enable template instantiation

CCROOTDIR/dbxprep
dbXtra debug processor

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/lib/CC

CCLIBDIR
/usr/lib/CC

I
/usr/include/CC:/usr/include

See also

cc(CP), ld(CP)

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.

Standards conformance

CC is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.


© 2003 Commands for Programming (CP)
SCO OpenServer Release 5.0.7 -- 11 February 2003