Commit | Line | Data |
---|---|---|
faa1e6a0 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 the obsolete debugger | |
48 | .IR sdb (1). | |
49 | Also pass the | |
50 | .B \-lg | |
51 | flag to | |
52 | .IR ld (1). | |
53 | .TP | |
54 | .B \-w | |
55 | Suppress warning diagnostics. | |
56 | .TP | |
57 | .B \-p | |
58 | Arrange for the compiler to produce code | |
59 | which counts the number of times each routine is called. | |
60 | If loading takes place, replace the standard startup | |
61 | routine by one which automatically calls | |
62 | .IR monitor (3) | |
63 | at the start and arranges to write out a | |
64 | .I mon.out | |
65 | file at normal termination of execution of the object program. | |
66 | An execution profile can then be generated by | |
67 | use of | |
68 | .IR prof (1). | |
69 | .TP | |
70 | .B \-pg | |
71 | Causes the compiler to produce counting code in the manner of | |
72 | .B \-p, | |
73 | but invokes a run-time recording mechanism that keeps more | |
74 | extensive statistics and produces a | |
75 | .I gmon.out | |
76 | file at normal termination. | |
77 | Also, a profiling library is searched, in lieu of the standard C library. | |
78 | An execution profile can then be generated by use of | |
79 | .IR gprof (1). | |
80 | .TP | |
81 | .SM | |
82 | .B \-O | |
83 | Invoke an | |
84 | object-code improver. | |
85 | .TP | |
86 | .SM | |
87 | .B \-R | |
88 | Passed on to | |
89 | .I as, | |
90 | making initialized variables shared and read-only. | |
91 | .TP | |
92 | .SM | |
93 | .B \-S | |
94 | Compile the named C programs, and leave the | |
95 | assembler-language output on corresponding files suffixed `.s'. | |
96 | .TP | |
97 | .SM | |
98 | .B \-E | |
99 | Run only the macro preprocessor | |
100 | on the named C programs, and send the result to the | |
101 | standard output. | |
102 | .TP | |
103 | .SM | |
104 | .B \-C | |
105 | prevent the macro preprocessor from eliding comments. | |
106 | .TP | |
107 | .BI \-o " output" | |
108 | Name the final output file | |
109 | .IR output . | |
110 | If this option is used the file `a.out' will be left undisturbed. | |
111 | .TP | |
112 | .SM | |
113 | .BI \-D name=def | |
114 | .br | |
115 | .ns | |
116 | .TP | |
117 | .SM | |
118 | .BI \-D \*Sname | |
119 | Define the | |
120 | .I name | |
121 | to the preprocessor, | |
122 | as if by | |
123 | `#define'. | |
124 | If no definition is given, the name is defined as "1". | |
125 | .TP | |
126 | .SM | |
127 | .BI \-U \*Sname | |
128 | Remove any initial definition of | |
129 | .IR name . | |
130 | .TP | |
131 | .SM | |
132 | .BI \-I \*Sdir | |
133 | `#include' files | |
134 | whose names do not begin with `/' are always | |
135 | sought first in the directory | |
136 | of the | |
137 | .I file | |
138 | argument, | |
139 | then in directories named in | |
140 | .B \-I | |
141 | options, | |
142 | then in directories on a standard list. | |
143 | .TP | |
144 | .SM | |
145 | .BI \-B \*Sstring | |
146 | Find substitute compiler passes in the files named | |
147 | .I string | |
148 | with the suffixes cpp, ccom and c2. | |
149 | If | |
150 | .I string | |
151 | is empty, use a standard backup version. | |
152 | .TP | |
153 | .BR \-t [ p012 ] | |
154 | Find only the designated compiler passes in the | |
155 | files whose names are constructed by a | |
156 | .B \-B | |
157 | option. | |
158 | In the absence of a | |
159 | .B \-B | |
160 | option, the | |
161 | .I string | |
162 | is taken to be `/usr/c/'. | |
163 | .PP | |
164 | Other arguments | |
165 | are taken | |
166 | to be either loader option arguments, or C-compatible | |
167 | object programs, typically produced by an earlier | |
168 | .I cc | |
169 | run, | |
170 | or perhaps libraries of C-compatible routines. | |
171 | These programs, together with the results of any | |
172 | compilations specified, are loaded (in the order | |
173 | given) to produce an executable program with name | |
174 | .B a.out. | |
175 | .SH FILES | |
176 | .ta \w'/usr/c/occom 'u | |
177 | file.c input file | |
178 | .br | |
179 | file.o object file | |
180 | .br | |
181 | a.out loaded output | |
182 | .br | |
183 | /tmp/ctm? temporary | |
184 | .br | |
185 | /lib/cpp preprocessor | |
186 | .br | |
187 | /lib/ccom compiler | |
188 | .br | |
189 | /usr/c/occom backup compiler | |
190 | .br | |
191 | /usr/c/ocpp backup preprocessor | |
192 | .br | |
193 | /lib/c2 optional optimizer | |
194 | .br | |
195 | /lib/crt0.o runtime startoff | |
196 | .br | |
197 | /lib/mcrt0.o startoff for profiling | |
198 | .br | |
199 | /usr/lib/gcrt0.o startoff for gprof-profiling | |
200 | .br | |
201 | /lib/libc.a standard library, see | |
202 | .IR intro (3) | |
203 | .br | |
204 | /usr/lib/libc_p.a profiling library, see | |
205 | .IR intro (3) | |
206 | .br | |
207 | /usr/include standard directory for `#include' files | |
208 | .br | |
209 | mon.out file produced for analysis by | |
210 | .IR prof (1) | |
211 | .br | |
212 | gmon.out file produced for analysis by | |
213 | .IR 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 | 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. |