CC
Section: User Commands (1)
Index
Return to Main Contents
NAME
CC - C++ translator
SYNOPSIS
CC
[ option ] ... file ...
DESCRIPTION
CC
(capital CC) translates C++ source code to C source code. The command
uses cpp(1) for preprocessing, cfront for syntax and type checking,
and cc(1) for code generation.
CC
assumes arguments ending in
- .c
-
are C++ source programs; they are compiled, and
each object program is left on the file
whose name is that of the source with
.o
substituted for
.c.
- .s
-
are assembly source programs; they are assembled into
.o
files.
CC
interprets the following options:
- -n
-
Print what would have been done, but don't do it.
- -v
-
Verbose mode. Print the commands as they are called.
- -C
-
Prevent
cpp
and
cfront
from removing comments.
- -E
-
Run only
cpp
on the
.c
files and send the result to standard output.
- -F
-
Run only
cpp
and
cfront
on the
.c
files and send the result to standard output.
- -Fc
-
Like the
-F
option, but the output is C source code suitable as a
.c
file for
cc(1).
- -.suffix
-
Instead of using standard output for the
-E ,
-F
or
-Fc
options, place the output from each
.c
file on a file with the corresponding
.suffix.
- -k
-
Keep the files __ctdt.c and __ctdt.o.
They are used to initialize global and static
class objects. Normally they are removed.
- -NOMUNCH
-
Do not run
nm
and
munch
on the resulting object file. This phase is normally
needed to detect static constructors and destructors.
- +d
-
Suppress expansion of inline functions.
- +e1,+e0
-
These flags affect how the compiler handles tables for
virtual functions.
+e1
causes the tables to be external and initialized;
+e0
causes the tables to be external and uninitialized.
If neither flag is specified (the default), the tables are
local (static) and initialized.
One file with all virtuals known to it
should be compiled with +e1; the rest should be compiled
with +e0. Having one external table may significantly
reduce compile time, link time and object file size.
- +I
-
Keep C source code produced by the front end in a ..c file.
Line number information is stripped.
- +V
-
Accept regular C function declarations; use the
/usr/include
directory for #include files.
Support for this option is not guaranteed in future releases
- +L
-
Generate source line number information using the format "#line %d"
instead of "#%d".
- +xfile
-
Read a file of sizes and alignments. Each line contains three fields:
a type name, the size (in bytes), and the alignment (in bytes). This option
is useful for cross compilation.
- +S
-
Spy on
cfront;
that is, print some information on
stderr.
If the file ".CCpath" exists in the current working
directory, the first line is assumed to be a colon
separated list of directories to be searched when
trying to find '#include' files. If the file ".CCpath"
doesn't exist, the environment variable CCPATH is used.
All this is an alternative to the -I flag of cc(1).
If set, the environment variables
ccpC
(preprocessor),
cfrontC
(C++ front end),
ccC
(c compiler),
assemblerC
(assembler),
linkerC
(linker), and
LIBRARY
(C++ library) override the defaults.
See
ld(1)
for loader options,
as(1)
for assembler options,
cc(1)
for code generation options,
and
cpp(1)
for preprocessor options.
FILES
file.c input file
file..c cfront output
file.o object file
a.out linked output
/lib/cpp C preprocessor
cfront C++ front end
/bin/cc C compiler
/lib/libc.a standard C library; see Section (3) in the UNIX System V Programmer Reference Manual
/usr/local/lib/libC.a C++ library
/usr/include/CC standard #include file directory
/usr/include #include file directory (+V flag)
SEE ALSO
cc(1), monitor(3), prof(1), ld(1).
Bjarne Stroustrup,
The C++ Programming Language,
Addison-Wesley 1986.
B. W. Kernighan and D. M. Ritchie,
The C Programming Language,
Prentice-Hall 1978.
DIAGNOSTICS
The diagnostics produced by
CC
itself are intended to be
self-explanatory.
Occasional messages may be produced by the assembler or loader.
No messages should be produced by
cc(1).
BUGS
Some ``used before set'' warnings are wrong.
There is a (temporary) hole in the C++ type system allowing C++ programs
to use C libraries. When a name is overloaded the first function of that
name (only) can be linked to a library compiled by cc. Thus,
the declaration
-
overload read(int,char*,int), read(vector*);
will allow the system call
read(2)
to be used together with user defined functions
of the same name.
Use of this facility may lead to unexpected behavior. For example,
had the other
read()
been declared first,
or had the system's
read()
not been declared,
then the user's
read()
would have been called by library functions like
scanf(3).
COPYRIGHT
Copyright (C) 1991 Texas Instruments Incorporated.
Permission is granted to any individual or institution to use, copy, modify,
and distribute this software, provided that this complete copyright and
permission notice is maintained, intact, in all copies and supporting
documentation.
Texas Instruments Incorporated provides this software "as is" without
express or implied warranty.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- FILES
-
- SEE ALSO
-
- DIAGNOSTICS
-
- BUGS
-
- COPYRIGHT
-
This document was created by
man2html,
using the manual pages.
Time: 20:44:10 GMT, July 24, 2024