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