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