file reorg, pathnames.h, paths.h
[unix-history] / usr / src / old / pcc / cc / cc.1
... / ...
CommitLineData
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)cc.1 6.3 (Berkeley) %G%
6.\"
7.TH CC 1 ""
8.UC 4
9.SH NAME
10cc \- C compiler
11.SH SYNOPSIS
12.B cc
13[ option ] ... file ...
14.SH DESCRIPTION
15.I Cc
16is the UNIX C compiler.
17.I Cc
18accepts several types of arguments:
19.PP
20Arguments whose names end with `.c' are taken to be
21C source programs; they are compiled, and
22each object program is left on the file
23whose name is that of the source with `.o' substituted
24for `.c'.
25The `.o' file is normally deleted, however, if a single
26C program is compiled and loaded all at one go.
27.PP
28In the same way,
29arguments whose names end with `.s' are taken to be assembly source programs
30and are assembled, producing a `.o' file.
31.PP
32The following options are interpreted by
33.IR cc .
34See
35.IR ld (1)
36for load-time options.
37.TP 8
38.B \-c
39Suppress the loading phase of the compilation, and force
40an object file to be produced even if only one program is compiled.
41.TP
42.B \-g
43Have the compiler produce additional symbol table information
44for
45.IR dbx (1).
46Also pass the
47.B \-lg
48flag to
49.IR ld (1).
50.TP
51.B \-go
52Have the compiler produce additional symbol table information
53for the obsolete debugger
54.IR sdb (1).
55Also pass the
56.B \-lg
57flag to
58.IR ld (1).
59.TP
60.B \-w
61Suppress warning diagnostics.
62.TP
63.B \-p
64Arrange for the compiler to produce code
65which counts the number of times each routine is called.
66If loading takes place, replace the standard startup
67routine by one which automatically calls
68.IR monitor (3)
69at the start and arranges to write out a
70.I mon.out
71file at normal termination of execution of the object program.
72An execution profile can then be generated by
73use of
74.IR prof (1).
75.TP
76.B \-pg
77Causes the compiler to produce counting code in the manner of
78.B \-p,
79but invokes a run-time recording mechanism that keeps more
80extensive statistics and produces a
81.I gmon.out
82file at normal termination.
83Also, a profiling library is searched, in lieu of the standard C library.
84An execution profile can then be generated by use of
85.IR gprof (1).
86.TP
87.SM
88.B \-O
89Invoke an
90object-code improver.
91.TP
92.SM
93.B \-R
94Passed on to
95.I as,
96making initialized variables shared and read-only.
97.TP
98.SM
99.B \-S
100Compile the named C programs, and leave the
101assembler-language output on corresponding files suffixed `.s'.
102.TP
103.SM
104.B \-M
105Run only the macro preprocessor
106on the named C programs,
107requesting it to generate Makefile dependencies
108and send the result to the standard output.
109.TP
110.SM
111.B \-E
112Run only the macro preprocessor
113on the named C programs, and send the result to the
114standard output.
115.TP
116.SM
117.B \-C
118prevent the macro preprocessor from eliding comments.
119.TP
120.BI \-o " output"
121Name the final output file
122.IR output .
123If this option is used the file `a.out' will be left undisturbed.
124.TP
125.SM
126.BI \-D name=def
127.br
128.ns
129.TP
130.SM
131.BI \-D \*Sname
132Define the
133.I name
134to the preprocessor,
135as if by
136`#define'.
137If no definition is given, the name is defined as "1".
138.TP
139.SM
140.BI \-U \*Sname
141Remove any initial definition of
142.IR name .
143.TP
144.SM
145.BI \-I \*Sdir
146`#include' files
147whose names do not begin with `/' are always
148sought first in the directory
149of the
150.I file
151argument,
152then in directories named in
153.B \-I
154options,
155then in directories on a standard list.
156.TP
157.SM
158.BI \-L \*Sdir
159Library archives are sought first in
160directories named in
161.B \-L
162options,
163then in directories on a standard list.
164.TP
165.B \-f
166Use an alternate compiler which does not convert expressions involving
167only floats to double. This does not conform to the standard which states
168that all intermediate results should be converted to double but does
169provide a speed improvement for programs which don't require full double
170precision. This option also makes
171.B "register float"
172variables work appropriately.
173.TP
174.SM
175.BI \-B \*Spath
176Find substitute compiler passes in the named path
177with the suffixes cpp, ccom and c2.
178.TP
179.BR \-t [ p012 ]
180Find only the designated compiler passes in the
181files whose names are constructed by a
182.B \-B
183option.
184In the absence of a
185.B \-B
186option, the
187.I string
188is taken to be `/usr/c/'.
189.PP
190Other arguments
191are taken
192to be either loader option arguments, or C-compatible
193object programs, typically produced by an earlier
194.I cc
195run,
196or perhaps libraries of C-compatible routines.
197These programs, together with the results of any
198compilations specified, are loaded (in the order
199given) to produce an executable program with name
200.B a.out.
201.SH FILES
202.ta \w'/usr/c/occom 'u
203file.c input file
204.br
205file.o object file
206.br
207a.out loaded output
208.br
209/tmp/ctm? temporary
210.br
211/lib/cpp preprocessor
212.br
213/lib/ccom compiler
214.br
215/lib/sccom compiler for single precision floats
216.br
217/usr/c/occom backup compiler
218.br
219/usr/c/ocpp backup preprocessor
220.br
221/lib/c2 optional optimizer
222.br
223/lib/crt0.o runtime startoff
224.br
225/lib/mcrt0.o startoff for profiling
226.br
227/usr/lib/gcrt0.o startoff for gprof-profiling
228.br
229/lib/libc.a standard library, see
230.IR intro (3)
231.br
232/usr/lib/libc_p.a profiling library, see
233.IR intro (3)
234.br
235/usr/include standard directory for `#include' files
236.br
237mon.out file produced for analysis by
238.IR prof (1)
239.br
240gmon.out file produced for analysis by
241.IR gprof (1)
242.SH "SEE ALSO"
243B. W. Kernighan and D. M. Ritchie,
244.I The C Programming Language,
245Prentice-Hall,
2461978
247.br
248B. W. Kernighan,
249.I
250Programming in C\(ema tutorial
251.br
252D. M. Ritchie,
253.I
254C Reference Manual
255.br
256monitor(3), prof(1), gprof(1), adb(1), ld(1), dbx(1), as(1)
257.SH DIAGNOSTICS
258The diagnostics produced by C itself are intended to be
259self-explanatory.
260Occasional messages may be produced by the assembler
261or loader.
262.SH BUGS
263The compiler currently ignores advice to put
264\fBchar\fR, \fBunsigned char\fR,
265\fBshort\fR, \fBunsigned short\fR,
266\fBfloat\fR, or \fBdouble\fR
267variables in registers, except as noted above. It previously
268produced poor, and in some cases incorrect, code for such declarations.