4.1cBSD/usr/doc/pascal/pc.1.dist

.TH PC 1
.UC 4
.SH NAME
pc \- Pascal compiler
.SH SYNOPSIS
.B pc
[ option ] [
.B \-i
name ...
] name ...
.SH DESCRIPTION
.I Pc
is a Pascal compiler.  It accepts several types of arguments:
Arguments whose names end with .p
are taken to be Pascal source files; they are compiled and each  
object file is left on the file whose name is that of the source with
`.o' substituted for `.p'.
If a single-file Pascal program is specified,
it is compiled and loaded,
and the `.o' is deleted.
.PP
A program may be separated into more than one file by placing common
definitions in header files with extension `.h'.  Functions and
procedures may be declared \fBexternal\fR (much like they would be
declared \fBforward\fR) in these header files.  So that reasonable header
files may be constructed, the restriction that \fBconst\fR, \fBtype\fR,
\fBvar\fR and \fBprocedure\fR and \fBfunction\fR \fBexternal\fR
declarations must appear only once and in this order is relaxed.
.PP
Exactly one of the separately compiled files must supply a \fBprogram\fR.
The rest of the files
must consist of procedures and functions which nest within the main
program.  The compiler checks that consistent usage has been made of objects
declared in header files, so that type checking is not
inadvertantly subverted due to separate compilation.  External procedures
may be used at the top level (i.e. procedures written in C); value and
var paramters are mapped to C conventions in the obvious way.  See the
Berkeley Pascal User's Manual for details.
.PP
The following options have the same meaning as in
.IR cc (1)
and
.IR f77 (1).
See
.IR ld (1)
for load-time options.
.TP 6
.B \-c
Suppress loading and produce `.o' files for the source file.
.TP 6
.B \-g
Have the compiler produce additional symbol table information for
.IR sdb (1).
.TP 6
.BR \-w
Suppress warning messages.
.TP 6
.B \-p
Prepare object files for profiling, see
.IR  prof (1).
.TP 6
.SM
.B \-O
Invoke an
object-code improver.
.TP 6
.SM
.B \-S
Compile the named program, and leave the
assembler-language output on the corresponding file suffixed `.s'.
(No `.o' is created.).
.TP 6
.BR \-o " output"
Name the final output file
.I output
instead of
.I a.out.
.PP
The following options are peculiar to
.IR pc .
.TP 6
.B \-C
Compile code to perform runtime checks,
verify
.B assert
statements,
and initialize all variables to zero as in
.IR pi .
.TP 6
.B  \-b
Block buffer the file
.I output.
.TP 6
.B  \-i
Produce a listing for
the specified procedures, functions and
.B include
files.
.TP 6
.B  \-l
Make a program listing during translation.
.TP 6
.B  \-s
Accept standard Pascal only;
non-standard constructs cause warning diagnostics.
.TP 6
.B  \-z
Allow execution profiling with
.I pxp
by generating statement counters, and arranging for the
creation of the profile data file
.I pmon.out
when the resulting object is executed.
.PP
Other arguments
are taken
to be either loader option arguments, or
.IR pc
compatible object programs, typically produced by an earlier run,
or perhaps libraries of
.IR pc
compatible routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program.
Certain flags can also be controlled in comments within the program
as described in the
.I "Berkeley Pascal User's Manual."
.SH FILES
.ta 2.5i
file.p	pascal source files
.br
file.h	\fBinclude\fR file(s)
.br
/usr/lib/pc[01]	compiler and code generator
.br
/usr/lib/pc2	procedure/function integrator (inline-expansion)
.br
/lib/c2	peephole optimizer
.br
/usr/lib/pc3	separate compilation consistency checker
.br
/usr/lib/pc2.0strings	text of the error messages
.br
/usr/lib/how_pc	basic usage explanation
.br
/usr/lib/libpc.a	intrinsic functions and I/O library
.br
/usr/lib/libm.a	math library
.br
/lib/lib[ac].a	standard libraries, see intro (3)
.SH "SEE ALSO"
Berkeley Pascal User's Manual
.br
pi(1),
pxp(1),
pxref(1),
sdb(1)
.SH DIAGNOSTICS
For a basic explanation do
.IP
.B pc
.PP
See 
.IR pi (1).
for an explanation of the error message format.
Internal errors cause messages containing the word SNARK.
.SH AUTHORS
Charles B. Haley, William N. Joy, and Ken Thompson
.br
Retargetted to the second pass of the portable
.IR C
compiler by Peter Kessler
.br
Runtime library and inline optimizer by M. Kirk McKusick
.br
Separate conpilation consistency checking by Louise Madrid
.SH BUGS
Formal parameters which are procedures and functions are not supported.
.PP
The keyword
.B packed
is recognized but has no effect.
.PP
Because the -s option is used by the compiler,
it is not possible to pass the strip option to the loader.
Thus programs which are to be stripped, must be run through 
.IR strip (1)
after the are compiled.