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