|
|
1.1 root 1: .TH CC 1 "4 May 1984"
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 the debugger
39: .IR cdb (1).
40: .TP
41: .B \-go
42: Have the compiler produce a shorter version of the additional symbol
43: table information
44: .TP
45: .B \-w
46: Suppress warning diagnostics.
47: .TP
48: .B \-p
49: Arrange for the compiler to produce code
50: which counts the number of times each routine is called.
51: If loading takes place, replace the standard startup
52: routine by one which automatically calls
53: .IR monitor (3)
54: at the start and arranges to write out a
55: .I mon.out
56: file at normal termination of execution of the object program.
57: An execution profile can then be generated by
58: use of
59: .IR prof (1).
60: .TP
61: .SM
62: .B \-O
63: Invoke an
64: object-code improver.
65: .TP
66: .SM
67: .B \-R
68: Passed on to
69: .I as,
70: making initialized variables shared and read-only.
71: .TP
72: .SM
73: .B \-S
74: Compile the named C programs, and leave the
75: assembler-language output on corresponding files suffixed `.s'.
76: .TP
77: .SM
78: .B \-E
79: Run only the macro preprocessor
80: on the named C programs, and send the result to the
81: standard output.
82: .TP
83: .SM
84: .B \-C
85: prevent the macro preprocessor from eliminating comments.
86: .TP
87: .BI \-o " output"
88: Passed on to
89: .I ld,
90: to name the final output file
91: .IR output .
92: If this option is used the file `a.out' will be left undisturbed.
93: .TP
94: .BI \-l \*Sxx
95: Passed on to
96: .I ld,
97: to load the library
98: .I libxx.a
99: from /lib or /usr/lib into the executable file; the most usefull are
100: `-lm' - the mathematical library, and `-lf' for the floating-point version
101: of `printf'.
102: .TP
103: .BI \-d \*Sn
104: Passed on to
105: .I as,
106: causing external references to occupy only
107: .I n
108: bytes, where
109: .I n
110: is 1, 2 or 4 (default).
111: .TP
112: .BI \-P
113: Passed on to
114: .I as,
115: to print a listing of the generated machine code into the standard output.
116: .TP
117: .BI \-L
118: Insert the C source line as comments in the `.s' file.
119: This option turns off -O.
120: .TP
121: .SM
122: .BI \-D name=def
123: .br
124: .ns
125: .TP
126: .SM
127: .BI \-D \*Sname
128: Define the
129: .I name
130: to the preprocessor,
131: as if by
132: `#define'.
133: If no definition is given, the name is defined as "1".
134: The macro preprocessor predefines `tahoe' (equivalent to
135: `-Dtahoe').
136: .TP
137: .SM
138: .BI \-U \*Sname
139: Remove any initial definition of
140: .IR name .
141: .TP
142: .SM
143: .BI \-I \*Sdir
144: `#include' files
145: whose names do not begin with `/' are always
146: sought first in the directory
147: of the
148: .I file
149: argument,
150: then in directories named in
151: .B \-I
152: options,
153: then in directories on a standard list.
154: .TP
155: .SM
156: .BI \-B \*Sstring
157: Find substitute compiler passes in the files named
158: .I string
159: with the suffixes cpp, ccom and c2.
160: If
161: .I string
162: is empty, use a standard backup version.
163: .TP
164: .BR \-t [ p012 ]
165: Find only the designated compiler passes in the
166: files whose names are constructed by a
167: .B \-B
168: option.
169: In the absence of a
170: .B \-B
171: option, the
172: .I string
173: is taken to be `/lib/o'.
174: .PP
175: Other arguments
176: are taken
177: to be either loader option arguments, or C-compatible
178: object programs, typically produced by an earlier
179: .I cc
180: run,
181: or perhaps libraries of C-compatible routines.
182: These programs, together with the results of any
183: compilations specified, are loaded (in the order
184: given) to produce an executable program with name
185: .B a.out.
186: .SH FILES
187: .ta \w'/usr/lib/libc_p.a 'u
188: file.c input file
189: .br
190: file.o object file
191: .br
192: a.out loaded output
193: .br
194: /tmp/cct? temporary
195: .br
196: /lib/cpp preprocessor
197: .br
198: /lib/ccom compiler
199: .br
200: /lib/c2 optional optimizer
201: .br
202: /lib/crt0.o runtime startoff
203: .br
204: /lib/mcrt0.o startoff for profiling
205: .br
206: /usr/bin/alist merging program for -L
207: .br
208: /lib/libc.a standard library, see
209: .IR intro (3)
210: .br
211: /usr/lib/libc_p.a profiling library, see
212: .IR intro (3)
213: .br
214: /usr/include standard directory for `#include' files
215: .br
216: mon.out file produced for analysis by
217: .IR prof (1)
218: .SH "SEE ALSO"
219: B. W. Kernighan and D. M. Ritchie,
220: .I The C Programming Language,
221: Prentice-Hall,
222: 1978
223: .br
224: B. W. Kernighan,
225: .I
226: Programming in C\(ema tutorial
227: .br
228: D. M. Ritchie,
229: .I
230: C Reference Manual
231: .br
232: monitor(3), prof(1), adb(1), ld(1), cdb(1), as(1)
233: .SH DIAGNOSTICS
234: The diagnostics produced by C itself are intended to be
235: self-explanatory.
236: Occasional messages may be produced by the assembler
237: or loader.
238: .SH BUGS
239: The compiler currently ignores advice to put
240: \fBchar\fR, \fBunsigned char\fR,
241: \fBshort\fR or \fBunsigned short\fR variables in registers.
242: .PP
243: The current version generate emulated code for floating point operations;
244: due to the size of the emulator, the standard I/O library is loaded without
245: it, and the `-lf' flag is needed for programs that produce floating point
246: output.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.