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