xref: /original-bsd/usr.bin/pascal/pc/pc.1 (revision c3e32dec)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)pc.1	8.1 (Berkeley) 06/06/93
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.Ic function Ns s
58and
59.Ic procedure Ns s
60to be declared, an
61.Ic external
62directive has been added, whose use is similar to the
63.Ic forward
64directive but restricted to appear only in
65.Pa \&.h
66files.
67.Ic Function
68and
69.Ic procedure
70bodies may not appear in
71.Pa \&.h
72files.
73A binding phase of the compiler checks that declarations
74are used consistently, to enforce the type checking rules of Pascal.
75.Pp
76Object files
77created by other language processors may be loaded together with
78object files created by
79.Nm \&pc  .
80The
81.Ic function Ns s
82and
83.Ic procedure Ns s
84they define must have been declared
85in
86.Pa \&.h
87files included by all the
88.Pa \&.p
89files which call those
90routines.
91Calling conventions are as in C,
92with
93.Ic var
94parameters passed by address.
95.Pp
96See the
97.%T "Berkeley Pascal User's Manual"
98for details.
99.Pp
100The following options have the same meaning as in
101.Xr cc  1
102and
103.Xr f77  1  .
104See
105.Xr \&ld  1
106for load-time options.
107.Bl -tag -width indent
108.It Fl c
109Suppress loading and produce `.o' file(s) from source file(s).
110.It Fl g
111Have the compiler produce additional symbol table information for
112.Xr dbx  1  .
113.It Fl w
114Suppress warning messages.
115.It Fl p
116Prepare object files for profiling, see
117.Xr prof  1  .
118.It Fl O
119Invoke an
120object-code improver.
121.It Fl S
122Compile the named program, and leave the
123assembler-language output on the corresponding file suffixed `.s'.
124(No `.o' is created.).
125.It Fl o Ns Ar output
126Name the final output file
127.Ar output
128instead of
129.Pa a.out .
130.El
131.Pp
132The following options are peculiar to
133.Nm pc  .
134.Bl -tag -width indent
135.It Fl C
136Compile code to perform runtime checks,
137verify
138.Ic assert
139calls,
140and initialize all variables to zero as in
141.Nm pi  .
142.It Fl b
143Block buffer the file
144.Ar output .
145.It Fl i
146Produce a listing for
147the specified procedures, functions and
148.Ar include
149files.
150.It Fl l
151Make a program listing during translation.
152.It Fl s
153Accept standard Pascal only;
154non-standard constructs cause warning diagnostics.
155.It Fl t Ar directory
156Use the given
157.Ar directory
158for compiler temporary files.
159.It Fl z
160Allow execution profiling with
161.Nm pxp
162by generating statement counters, and arranging for the
163creation of the profile data file
164.Pa pmon.out
165when the resulting object is executed.
166.El
167.Pp
168Other arguments
169are taken
170to be loader option arguments,
171perhaps libraries of
172.Nm \&pc
173compatible routines.
174Certain flags can also be controlled in comments within the program
175as described in the
176.%T "Berkeley Pascal User's Manual."
177.Sh FILES
178.Bl -tag -width /usr/lib.pc2.*strings -compact
179.It Pa file.p
180Pascal source files.
181.It Pa /usr/lib/pc0
182Compiler.
183.It Pa /lib/f1
184Code generator.
185.It Pa /usr/lib/pc2
186Runtime integrator (inline expander).
187.It Pa /lib/c2
188Peephole optimizer.
189.It Pa /usr/lib/pc3
190Separate compilation consistency checker.
191.It Pa /usr/lib/pc2.*strings
192Text of the error messages.
193.It Pa /usr/lib/how_pc
194Basic usage explanation.
195.It Pa /usr/lib/libpc.a
196Intrinsic functions and
197.Tn I/O
198library.
199.It Pa /usr/lib/libm.a
200Math library.
201.It Pa /lib/libc.a
202Standard library, see
203.Xr intro 3 .
204.El
205.Sh SEE ALSO
206.Xr \&pi 1 ,
207.Xr pxp 1 ,
208.Xr pxref 1 ,
209.Rs
210.%T "Berkeley Pascal User's Manual"
211.Re
212.Sh HISTORY
213The
214.Nm \&pc
215appeared in
216.Bx 4.0 .
217.Sh DIAGNOSTICS
218For a basic explanation do
219.Pp
220.Bd -literal -offset indent
221pc
222.Ed
223.Pp
224See
225.Xr \&pi 1  .
226for an explanation of the error message format.
227Internal errors cause messages containing the word
228.Tn SNARK .
229.Sh BUGS
230The keyword
231.Ic packed
232is recognized but has no effect.
233.Pp
234The binder is not as strict as described here,
235with regard to the rules about external declarations only
236in `.h' files and including `.h' files only at the outermost level.
237It will be made to perform these checks in its next incarnation,
238so users are warned not to be sloppy.
239.Pp
240The
241.Fl z
242flag doesn't work for separately compiled files.
243.Pp
244Because the
245.Fl s
246option is usurped by the compiler,
247it is not possible to pass the strip option to the loader.
248Thus programs which are to be stripped, must be run through
249.Xr strip  1
250after they are compiled.
251