add .Vx so tmac.andoc will call tmac.mdoc-old
[unix-history] / usr / src / usr.bin / pascal / pc / pc.1
CommitLineData
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
21is a Pascal compiler.
22If given an argument file ending with
b5dc1377
CL
23.Pa \&.p ,
24it will compile the file
018a1af3
KM
25and load it
26into an executable file called, by default,
b5dc1377
CL
27.Pa a.out .
28.Pp
29A program may be separated into more than one
30.Pa \&.p
018a1af3 31file.
b5dc1377 32.Nm Pc
018a1af3 33will compile a number of argument
b5dc1377 34.Pa \&.p
018a1af3
KM
35files into object files (with
36the extension
b5dc1377 37.Pa \&.o
018a1af3 38in place of
b5dc1377
CL
39.Pa \&.p ) .
40Object files may then be loaded
018a1af3 41into an executable
b5dc1377 42.Pa a.out
018a1af3 43file.
b5dc1377
CL
44Exactly one object file must supply a
45.Ar program
018a1af3 46statement to successfully create an executable a.out file.
b5dc1377 47The rest of the files must consist only of
018a1af3
KM
48declarations which logically nest within the program.
49References to objects shared between separately compiled files
50are allowed if the objects are declared in
b5dc1377 51.Ic included
018a1af3 52header files, whose names must end with
b5dc1377 53.Pa \&.h .
018a1af3
KM
54Header files may only be included at the outermost level,
55and thus declare only globally available objects.
56To allow
b5dc1377
CL
57.Cx Ic function
58.Cx s
59.Cx
018a1af3 60and
b5dc1377
CL
61.Cx Ic procedure
62.Cx s
63.Cx
018a1af3 64to be declared, an
b5dc1377 65.Ic external
018a1af3 66directive has been added, whose use is similar to the
b5dc1377 67.Ic forward
018a1af3 68directive but restricted to appear only in
b5dc1377 69.Pa \&.h
018a1af3 70files.
b5dc1377
CL
71.Ic Function
72and
73.Ic procedure
018a1af3 74bodies may not appear in
b5dc1377 75.Pa \&.h
018a1af3
KM
76files.
77A binding phase of the compiler checks that declarations
78are used consistently, to enforce the type checking rules of Pascal.
b5dc1377
CL
79.Pp
80Object files
018a1af3 81created by other language processors may be loaded together with
b5dc1377
CL
82object files created by
83.Nm pc .
018a1af3 84The
b5dc1377
CL
85.Cx Ic function
86.Cx s
87.Cx
018a1af3 88and
b5dc1377
CL
89.Cx Ic procedure
90.Cx s
91.Cx
018a1af3
KM
92they define must have been declared
93in
b5dc1377 94.Pa \&.h
018a1af3 95files included by all the
b5dc1377 96.Pa \&.p
018a1af3
KM
97files which call those
98routines.
99Calling conventions are as in C,
100with
b5dc1377 101.Ic var
018a1af3 102parameters passed by address.
b5dc1377 103.Pp
018a1af3 104See the Berkeley Pascal User's Manual for details.
b5dc1377 105.Pp
018a1af3 106The following options have the same meaning as in
b5dc1377 107.Xr cc 1
018a1af3 108and
b5dc1377 109.Xr f77 1 .
018a1af3 110See
b5dc1377 111.Xr ld 1
018a1af3 112for load-time options.
b5dc1377
CL
113.Tw Fl
114.Tp Fl c
018a1af3 115Suppress loading and produce `.o' file(s) from source file(s).
b5dc1377 116.Tp Fl g
018a1af3 117Have the compiler produce additional symbol table information for
b5dc1377
CL
118.Xr dbx 1 .
119.Tp Fl w
018a1af3 120Suppress warning messages.
b5dc1377 121.Tp Fl p
018a1af3 122Prepare object files for profiling, see
b5dc1377
CL
123.Xr prof 1 .
124.Tp Fl O
018a1af3
KM
125Invoke an
126object-code improver.
b5dc1377 127.Tp Fl S
018a1af3
KM
128Compile the named program, and leave the
129assembler-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 135Name the final output file
b5dc1377 136.Ar output
018a1af3 137instead of
b5dc1377
CL
138.Pa a.out .
139.Tp
140.Pp
018a1af3 141The following options are peculiar to
b5dc1377
CL
142.Nm pc .
143.Tw Fl
144.Tp Fl C
018a1af3
KM
145Compile code to perform runtime checks,
146verify
b5dc1377 147.Ic assert
fc8e6bdf 148calls,
018a1af3 149and initialize all variables to zero as in
b5dc1377
CL
150.Nm pi .
151.Tp Fl b
018a1af3 152Block buffer the file
b5dc1377
CL
153.Ar output .
154.Tp Fl i
018a1af3
KM
155Produce a listing for
156the specified procedures, functions and
b5dc1377 157.Ar include
018a1af3 158files.
b5dc1377 159.Tp Fl l
018a1af3 160Make a program listing during translation.
b5dc1377 161.Tp Fl s
018a1af3
KM
162Accept standard Pascal only;
163non-standard constructs cause warning diagnostics.
b5dc1377
CL
164.Tp Cx Fl t
165.Ws
166.Ar directory
167.Cx
fc8e6bdf 168Use the given
b5dc1377 169.Ar directory
fc8e6bdf 170for compiler temporary files.
b5dc1377 171.Tp Fl z
018a1af3 172Allow execution profiling with
b5dc1377 173.Nm pxp
018a1af3
KM
174by generating statement counters, and arranging for the
175creation of the profile data file
b5dc1377 176.Pa pmon.out
018a1af3 177when the resulting object is executed.
b5dc1377
CL
178.Pp
179.Tp
018a1af3
KM
180Other arguments
181are taken
182to be loader option arguments,
183perhaps libraries of
b5dc1377 184.Nm pc
018a1af3
KM
185compatible routines.
186Certain flags can also be controlled in comments within the program
187as 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
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
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
225appeared in 4.0 BSD.
226.Sh DIAGNOSTICS
018a1af3 227For a basic explanation do
b5dc1377
CL
228.Pp
229.Df I
230.Nm pc
231.De
232.Pp
233See
234.Xr pi 1 .
018a1af3
KM
235for an explanation of the error message format.
236Internal errors cause messages containing the word SNARK.
b5dc1377 237.Sh AUTHORS
018a1af3
KM
238Charles B. Haley, William N. Joy, and Ken Thompson
239.br
240Retargetted to the second pass of the portable
b5dc1377 241.Ar C
018a1af3
KM
242compiler by Peter Kessler
243.br
244Runtime library and inline optimizer by M. Kirk McKusick
245.br
246Separate compilation consistency checking by Louise Madrid
b5dc1377 247.Sh BUGS
018a1af3 248The keyword
b5dc1377 249.Ic packed
018a1af3 250is recognized but has no effect.
b5dc1377 251.Pp
018a1af3
KM
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.
b5dc1377 257.Pp
018a1af3 258The
b5dc1377 259.Fl z
018a1af3 260flag doesn't work for separately compiled files.
b5dc1377 261.Pp
018a1af3 262Because the
b5dc1377 263.Fl s
018a1af3
KM
264option is usurped by the compiler,
265it is not possible to pass the strip option to the loader.
b5dc1377
CL
266Thus programs which are to be stripped, must be run through
267.Xr strip 1
018a1af3 268after they are compiled.