BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / cc.0
CC(1) UNIX Programmer's Manual CC(1)
N\bNA\bAM\bME\bE
cc - C compiler
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
c\bcc\bc [ option ] ... file ...
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bC_\bc is the UNIX C compiler. _\bC_\bc accepts several types of
arguments:
Arguments whose names end with `.c' 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 `.o' sub-
stituted for `.c'. The `.o' file is normally deleted, how-
ever, if a single C program is compiled and loaded all at
one go.
In the same way, arguments whose names end with `.s' are
taken to be assembly source programs and are assembled, pro-
ducing a `.o' file.
The following options are interpreted by _\bc_\bc. See _\bl_\bd(1) for
load-time options.
-\b-c\bc Suppress the loading phase of the compilation, and
force an object file to be produced even if only one
program is compiled.
-\b-g\bg Have the compiler produce additional symbol table
information for _\bd_\bb_\bx(1). Also pass the -\b-l\blg\bg flag to
_\bl_\bd(1).
-\b-g\bgo\bo Have the compiler produce additional symbol table
information for the obsolete debugger _\bs_\bd_\bb(1). Also
pass the -\b-l\blg\bg flag to _\bl_\bd(1).
-\b-w\bw Suppress warning diagnostics.
-\b-p\bp Arrange for the compiler to produce code which
counts the number of times each routine is called.
If loading takes place, replace the standard startup
routine by one which automatically calls _\bm_\bo_\bn_\bi_\bt_\bo_\br(3)
at the start and arranges to write out a _\bm_\bo_\bn._\bo_\bu_\bt
file at normal termination of execution of the
object program. An execution profile can then be
generated by use of _\bp_\br_\bo_\bf(1).
-\b-p\bpg\bg Causes the compiler to produce counting code in the
manner of -\b-p\bp,\b, but invokes a run-time recording
mechanism that keeps more extensive statistics and
produces a _\bg_\bm_\bo_\bn._\bo_\bu_\bt file at normal termination.
Also, a profiling library is searched, in lieu of
Printed 7/9/88 June 7, 1985 1
CC(1) UNIX Programmer's Manual CC(1)
the standard C library. An execution profile can
then be generated by use of _\bg_\bp_\br_\bo_\bf(1).
-\b-O\bO Invoke an object-code improver.
-\b-R\bR Passed on to _\ba_\bs, making initialized variables shared
and read-only.
-\b-S\bS Compile the named C programs, and leave the
assembler-language output on corresponding files
suffixed `.s'.
-\b-M\bM Run only the macro preprocessor on the named C pro-
grams, requesting it to generate Makefile dependen-
cies and send the result to the standard output.
-\b-E\bE Run only the macro preprocessor on the named C pro-
grams, and send the result to the standard output.
-\b-C\bC prevent the macro preprocessor from eliding com-
ments.
-\b-o\bo _\bo_\bu_\bt_\bp_\bu_\bt
Name the final output file _\bo_\bu_\bt_\bp_\bu_\bt. If this option
is used the file `a.out' will be left undisturbed.
-\b-D\bD_\bn_\ba_\bm_\be=_\bd_\be_\bf
-\b-D\bD_\bn_\ba_\bm_\be Define the _\bn_\ba_\bm_\be to the preprocessor, as if by
`#define'. If no definition is given, the name is
defined as "1".
-\b-U\bU_\bn_\ba_\bm_\be Remove any initial definition of _\bn_\ba_\bm_\be.
-\b-I\bI_\bd_\bi_\br `#include' files whose names do not begin with `/'
are always sought first in the directory of the _\bf_\bi_\bl_\be
argument, then in directories named in -\b-I\bI options,
then in directories on a standard list.
-\b-L\bL_\bd_\bi_\br Library archives are sought first in directories
named in -\b-L\bL options, then in directories on a stan-
dard list.
-\b-f\bf Use an alternate compiler which does not convert
expressions involving only floats to double. This
does not conform to the standard which states that
all intermediate results should be converted to dou-
ble but does provide a speed improvement for pro-
grams which don't require full double precision.
This option also makes r\bre\beg\bgi\bis\bst\bte\ber\br f\bfl\blo\boa\bat\bt variables work
appropriately.
-\b-B\bB_\bs_\bt_\br_\bi_\bn_\bg
Printed 7/9/88 June 7, 1985 2
CC(1) UNIX Programmer's Manual CC(1)
Find substitute compiler passes in the files named
_\bs_\bt_\br_\bi_\bn_\bg with the suffixes cpp, ccom and c2. If
_\bs_\bt_\br_\bi_\bn_\bg is empty, use a standard backup version.
-\b-t\bt[p\bp0\b01\b12\b2]
Find only the designated compiler passes in the
files whose names are constructed by a -\b-B\bB option.
In the absence of a -\b-B\bB option, the _\bs_\bt_\br_\bi_\bn_\bg is taken
to be `/usr/c/'.
Other arguments are taken to be either loader option argu-
ments, or C-compatible object programs, typically produced
by an earlier _\bc_\bc run, or perhaps libraries of C-compatible
routines. These programs, together with the results of any
compilations specified, are loaded (in the order given) to
produce an executable program with name a\ba.\b.o\bou\but\bt.\b.
F\bFI\bIL\bLE\bES\bS
file.c input file
file.o object file
a.out loaded output
/tmp/ctm? temporary
/lib/cpp preprocessor
/lib/ccom compiler
/lib/sccom compiler for single precision floats
/usr/c/occom backup compiler
/usr/c/ocpp backup preprocessor
/lib/c2 optional optimizer
/lib/crt0.o runtime startoff
/lib/mcrt0.o startoff for profiling
/usr/lib/gcrt0.ostartoff for gprof-profiling
/lib/libc.a standard library, see _\bi_\bn_\bt_\br_\bo(3)
/usr/lib/libc_p.aprofiling library, see _\bi_\bn_\bt_\br_\bo(3)
/usr/include standard directory for `#include' files
mon.out file produced for analysis by _\bp_\br_\bo_\bf(1)
gmon.out file produced for analysis by _\bg_\bp_\br_\bo_\bf(1)
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
B. W. Kernighan and D. M. Ritchie, _\bT_\bh_\be _\bC _\bP_\br_\bo_\bg_\br_\ba_\bm_\bm_\bi_\bn_\bg
_\bL_\ba_\bn_\bg_\bu_\ba_\bg_\be, Prentice-Hall, 1978
B. W. Kernighan, _\bP_\br_\bo_\bg_\br_\ba_\bm_\bm_\bi_\bn_\bg _\bi_\bn _\bC-_\ba _\bt_\bu_\bt_\bo_\br_\bi_\ba_\bl
D. M. Ritchie, _\bC _\bR_\be_\bf_\be_\br_\be_\bn_\bc_\be _\bM_\ba_\bn_\bu_\ba_\bl
monitor(3), prof(1), gprof(1), adb(1), ld(1), dbx(1), as(1)
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
The diagnostics produced by C itself are intended to be
self-explanatory. Occasional messages may be produced by
the assembler or loader.
B\bBU\bUG\bGS\bS
The compiler currently ignores advice to put c\bch\bha\bar\br, u\bun\bns\bsi\big\bgn\bne\bed\bd
c\bch\bha\bar\br, s\bsh\bho\bor\brt\bt, u\bun\bns\bsi\big\bgn\bne\bed\bd s\bsh\bho\bor\brt\bt, f\bfl\blo\boa\bat\bt, or d\bdo\bou\bub\bbl\ble\be variables in
Printed 7/9/88 June 7, 1985 3
CC(1) UNIX Programmer's Manual CC(1)
registers, except as noted above. It previously produced
poor, and in some cases incorrect, code for such declara-
tions.
Printed 7/9/88 June 7, 1985 4