#ident    "@(#)sdb:cfront/CC.1    1.1"
CC(1)

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 takes arguments ending in .c, .C or .i to be C++ source programs. .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).

CC interprets the following options:

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

+V  Accept regular C function declarations; use the /usr/include directory #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".

+x file
    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 compilations.

+e  Optimize a program by ensuring that only one virtual table is generated per class. +e1 causes virtual tables to be external and defined, that is, initialized. +e0 causes virtual tables to be external but only declared, that is, uninitialized.

+S  Spy on cfront; that is, print some information on stderr.

    See ld(1) or loader options, as(1) for assembler options, cc(1) for code generation options, and cpp(1) for preprocessor options.

FILES
file.[Cc]    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
/lib/libC.a    C++ library
/usr/include/CC    standard directory for #include files
/usr/include    standard directory for #include files
when the +V option is used

SEE ALSO
cc(1), monitor(3), prof(1), ld(1), cpp(1), as(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 read() not been declared, then the user's read() would have been called by library functions like scanf(3).