SysIII/usr/src/man/man1/cc.1
.TH CC 1
.SH NAME
cc, pcc \- C compiler
.SH SYNOPSIS
.B cc
[ option ] ... file ...
.br
.B pcc
[ option ] ... file ...
.SH DESCRIPTION
.I Cc\^
is the \s-1UNIX\s+1 C compiler.
.I Pcc\^
is the portable version for a \s-1PDP\s+1-11 machine.
They accept several types of arguments:
.PP
Arguments whose names end with \f3.c\fP are taken to
be C source programs; they are compiled, and
each object program is left on the file
whose name is that of the source with \f3.o\fP substituted
for \f3.c\fP.
The \f3.o\fP file is normally deleted, however, if a
single C program is compiled and loaded all at one go.
.PP
In the same way,
arguments whose names end with \f3.s\fP are taken to be assembly source programs
and are assembled, producing a \f3.o\fP file.
.PP
The following options are interpreted by
.I cc\^
and
.IR pcc .
See
.IR ld (1)
for link editor options.
.TP 8
.B \-c
Suppress the link edit phase of the compilation, and force
an object file to be produced even if only one program is compiled.
.TP
.B \-p
Arrange for the compiler to produce code
which counts the number of times each routine is called;
also, if link editing takes place, replace the standard startoff
routine by one which automatically calls
.IR 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
.IR prof (1).
.TP
.B \-f
Link the object program with the floating-point interpreter
for systems without hardware floating-point.
.TP
.B \-g
Cause the compiler
to generate additional information
needed for the use of
.IR sdb (1).
(\s-1VAX\s0-11/780 only.)
.TP
.BI \-d n\^
This option is passed through to
.IR as (1).
(\s-1VAX\s0 only.)
.TP
.B \-O
Invoke an
object-code optimizer.
.TP
.B \-S
Compile the named C programs, and leave the
assembler-language output on corresponding files suffixed \f3.s\fP.
.TP
.B \-E
Run only the macro preprocessor
on the named C programs, and send the result to the
standard output.
.TP
.B \-P
Run only the macro preprocessor
on the named C programs, and leave the result
on corresponding files suffixed \f3.i\fP.
.TP
.B \-C
Comments are not stripped by the macro preprocessor.
.TP
.BI \-D name=def\^
.br
.ns
.TP
.BI \-D name\^
Define the
.I name\^
to the preprocessor,
as if by
.BR #define .
If no definition is given, the name is defined as 1.
.TP
.BI \-U name\^
Remove any initial definition of
.IR name .
.TP
.BI \-I dir\^
Change the algorithm for searching for
.B #include
files
whose names do not begin with \f3/\fP
to look in
.I dir\^
before looking in the directories on the standard list.
Thus,
.B #include
files whose names are enclosed in \f3"\|"\fP
will be searched for
first in the directory of the
.I file\^
argument,
then in directories named in
.B \-I
options,
and last in directories on a standard list.
For
.B #include
files whose names are enclosed in
.BR <> ,
the directory of the
.I file\^
argument is not searched.
.TP
.BI \-B string\^
Find substitute compiler passes in the files named
.I string\^
with the suffixes
.BR cpp ,
.BR c0 ,
.B c1
and
.BR c2 .
If
.I string\^
is empty, use a standard backup version.
.TP
.BR \-t [ p012 ]
Find only the designated compiler passes in the
files whose names are constructed by a
.B \-B
option.
In the absence of a
.B \-B
option, the
.I string\^
is taken to be
.BR /lib/n .
.PP
Other arguments
are taken
to be either link editor option arguments, or C-compatible
object programs, typically produced by an earlier
.I cc\^
or
.I pcc\^
run,
or perhaps libraries of 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 FILES
.PD 0
.TP 1i
file.c
input file
.TP
file.o
object file
.TP
a.out
linked output
.TP
/tmp/ctm\(**
temporary
.TP
/lib/cpp
preprocessor
.TP
/lib/c[01]
.SM PDP-11
compiler,
.I cc\^
.TP
/usr/lib/comp
compiler,
.I pcc\^
.TP
/lib/ccom
.SM VAX
compiler,
.I cc\^
.TP
/lib/c2
optional optimizer
.TP
/lib/oc\(**
backup compiler,
.I occ\^
.TP
/lib/nc\(**
test compiler,
.I ncc\^
.TP
/lib/fc1
.SM PDP-11
floating-point compiler,
.I cc\^
.TP
/lib/crt0.o
runtime startoff
.TP
/lib/mcrt0.o
startoff for profiling
.TP
/lib/fcrt0.o
startoff for floating-point interpretation
.TP
/lib/libc.a
standard library, see (3)
.TP
/usr/include
standard directory for
.B #include
files
.PD
.SH SEE ALSO
B. W. Kernighan and D. M. Ritchie,
.IR "The C Programming Language" ,
Prentice-Hall, 1978.
.br
B. W. Kernighan,
.I
Programming in C\-A Tutorial.
.br
D. M. Ritchie,
.I
C Reference Manual.
.br
adb(1), as(1), ld(1), prof(1), monitor(3C).
.SH DIAGNOSTICS
The diagnostics produced by C itself are intended to be
self-explanatory.
Occasional messages may be produced by the assembler or the link editor.
Of these, the most mystifying are from the
.SM PDP\*S-11
assembler, in particular
.BR m ,
which means
a multiply-defined external symbol (function
or data).