Commit | Line | Data |
---|---|---|
018a1af3 KM |
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 | .\" @(#)pc.1 4.1 (Berkeley) %G% | |
6 | .\" | |
7 | .TH PC 1 | |
8 | .UC 4 | |
9 | .SH NAME | |
10 | pc \- Pascal compiler | |
11 | .SH SYNOPSIS | |
12 | .B pc | |
13 | [ option ] [ | |
14 | .B \-i | |
15 | name ... | |
16 | ] name ... | |
17 | .SH DESCRIPTION | |
18 | .I Pc | |
19 | is a Pascal compiler. | |
20 | If given an argument file ending with | |
21 | .BR .p , | |
22 | it will compile the file | |
23 | and load it | |
24 | into an executable file called, by default, | |
25 | .IR a.out . | |
26 | .PP | |
27 | A program may be separated into more than one | |
28 | .B .p | |
29 | file. | |
30 | .I Pc | |
31 | will compile a number of argument | |
32 | .B .p | |
33 | files into object files (with | |
34 | the extension | |
35 | .B .o | |
36 | in place of | |
37 | .BR .p ). | |
38 | Object files may then be loaded | |
39 | into an executable | |
40 | .I a.out | |
41 | file. | |
42 | Exactly one object file must supply a | |
43 | .B program | |
44 | statement to successfully create an executable a.out file. | |
45 | The rest of the files must consist only of | |
46 | declarations which logically nest within the program. | |
47 | References to objects shared between separately compiled files | |
48 | are allowed if the objects are declared in | |
49 | .BR include d | |
50 | header files, whose names must end with | |
51 | .BR .h . | |
52 | Header files may only be included at the outermost level, | |
53 | and thus declare only globally available objects. | |
54 | To allow | |
55 | .BR function s | |
56 | and | |
57 | .BR procedure s | |
58 | to be declared, an | |
59 | .B external | |
60 | directive has been added, whose use is similar to the | |
61 | .B forward | |
62 | directive but restricted to appear only in | |
63 | .B .h | |
64 | files. | |
65 | .B Function | |
66 | and | |
67 | .B procedure | |
68 | bodies may not appear in | |
69 | .B .h | |
70 | files. | |
71 | A binding phase of the compiler checks that declarations | |
72 | are used consistently, to enforce the type checking rules of Pascal. | |
73 | .PP | |
74 | Object files | |
75 | created by other language processors may be loaded together with | |
76 | object files created by | |
77 | .IR pc . | |
78 | The | |
79 | .BR function s | |
80 | and | |
81 | .BR procedure s | |
82 | they define must have been declared | |
83 | in | |
84 | .B .h | |
85 | files included by all the | |
86 | .B .p | |
87 | files which call those | |
88 | routines. | |
89 | Calling conventions are as in C, | |
90 | with | |
91 | .B var | |
92 | parameters passed by address. | |
93 | .PP | |
94 | See the Berkeley Pascal User's Manual for details. | |
95 | .PP | |
96 | The following options have the same meaning as in | |
97 | .IR cc (1) | |
98 | and | |
99 | .IR f77 (1). | |
100 | See | |
101 | .IR ld (1) | |
102 | for load-time options. | |
103 | .TP 6 | |
104 | .B \-c | |
105 | Suppress loading and produce `.o' file(s) from source file(s). | |
106 | .TP 6 | |
107 | .B \-g | |
108 | Have the compiler produce additional symbol table information for | |
109 | .IR sdb (1). | |
110 | .TP 6 | |
111 | .BR \-w | |
112 | Suppress warning messages. | |
113 | .TP 6 | |
114 | .B \-p | |
115 | Prepare object files for profiling, see | |
116 | .IR prof (1). | |
117 | .TP 6 | |
118 | .SM | |
119 | .B \-O | |
120 | Invoke an | |
121 | object-code improver. | |
122 | .TP 6 | |
123 | .SM | |
124 | .B \-S | |
125 | Compile the named program, and leave the | |
126 | assembler-language output on the corresponding file suffixed `.s'. | |
127 | (No `.o' is created.). | |
128 | .TP 6 | |
129 | .BR \-o " output" | |
130 | Name the final output file | |
131 | .I output | |
132 | instead of | |
133 | .I a.out. | |
134 | .PP | |
135 | The following options are peculiar to | |
136 | .IR pc . | |
137 | .TP 6 | |
138 | .B \-C | |
139 | Compile code to perform runtime checks, | |
140 | verify | |
141 | .B assert | |
142 | statements, | |
143 | and initialize all variables to zero as in | |
144 | .IR pi . | |
145 | .TP 6 | |
146 | .B \-b | |
147 | Block buffer the file | |
148 | .I output. | |
149 | .TP 6 | |
150 | .B \-i | |
151 | Produce a listing for | |
152 | the specified procedures, functions and | |
153 | .B include | |
154 | files. | |
155 | .TP 6 | |
156 | .B \-l | |
157 | Make a program listing during translation. | |
158 | .TP 6 | |
159 | .B \-s | |
160 | Accept standard Pascal only; | |
161 | non-standard constructs cause warning diagnostics. | |
162 | .TP 6 | |
163 | .B \-z | |
164 | Allow execution profiling with | |
165 | .I pxp | |
166 | by generating statement counters, and arranging for the | |
167 | creation of the profile data file | |
168 | .I pmon.out | |
169 | when the resulting object is executed. | |
170 | .PP | |
171 | Other arguments | |
172 | are taken | |
173 | to be loader option arguments, | |
174 | perhaps libraries of | |
175 | .IR pc | |
176 | compatible routines. | |
177 | Certain flags can also be controlled in comments within the program | |
178 | as described in the | |
179 | .I "Berkeley Pascal User's Manual." | |
180 | .SH FILES | |
181 | .ta 2.5i | |
182 | file.p pascal source files | |
183 | .br | |
184 | /usr/lib/pc0 compiler | |
185 | .br | |
186 | /lib/f1 code generator | |
187 | .br | |
188 | /usr/lib/pc2 runtime integrator (inline expander) | |
189 | .br | |
190 | /lib/c2 peephole optimizer | |
191 | .br | |
192 | /usr/lib/pc3 separate compilation consistency checker | |
193 | .br | |
194 | /usr/lib/pc2.0strings text of the error messages | |
195 | .br | |
196 | /usr/lib/how_pc basic usage explanation | |
197 | .br | |
198 | /usr/lib/libpc.a intrinsic functions and I/O library | |
199 | .br | |
200 | /usr/lib/libm.a math library | |
201 | .br | |
202 | /lib/libc.a standard library, see \fIintro\fP(3) | |
203 | .SH "SEE ALSO" | |
204 | Berkeley Pascal User's Manual | |
205 | .br | |
206 | pi(1), | |
207 | pxp(1), | |
208 | pxref(1), | |
209 | sdb(1) | |
210 | .SH DIAGNOSTICS | |
211 | For a basic explanation do | |
212 | .IP | |
213 | .B pc | |
214 | .PP | |
215 | See | |
216 | .IR pi (1). | |
217 | for an explanation of the error message format. | |
218 | Internal errors cause messages containing the word SNARK. | |
219 | .SH AUTHORS | |
220 | Charles B. Haley, William N. Joy, and Ken Thompson | |
221 | .br | |
222 | Retargetted to the second pass of the portable | |
223 | .IR C | |
224 | compiler by Peter Kessler | |
225 | .br | |
226 | Runtime library and inline optimizer by M. Kirk McKusick | |
227 | .br | |
228 | Separate compilation consistency checking by Louise Madrid | |
229 | .SH BUGS | |
230 | The keyword | |
231 | .B packed | |
232 | is recognized but has no effect. | |
233 | .PP | |
234 | The binder is not as strict as described here, | |
235 | with regard to the rules about external declarations only | |
236 | in `.h' files and including `.h' files only at the outermost level. | |
237 | It will be made to perform these checks in its next incarnation, | |
238 | so users are warned not to be sloppy. | |
239 | .PP | |
240 | The | |
241 | .B \-z | |
242 | flag doesn't work for separately compiled files. | |
243 | .PP | |
244 | Because the | |
245 | .B \-s | |
246 | option is usurped by the compiler, | |
247 | it is not possible to pass the strip option to the loader. | |
248 | Thus programs which are to be stripped, must be run through | |
249 | .IR strip (1) | |
250 | after they are compiled. |