PC(1) COMMAND REFERENCE PC(1)
NAME
pc - Pascal compiler
SYNOPSIS
pc [ option ] [ -i filename... ] filename...
DESCRIPTION
Pc is a Pascal compiler. If given an argument file ending
with .p, it compiles the file and loads it into an
executable file called, by default, a.out.
A program may be separated into more than one .p file. Pc
compiles a number of argument .p files into object files
(with the extension .o in place of .p). Object files may
then be loaded into an executable a.out file. Exactly one
object file must supply a program statement to successfully
create an executable a.out file. The rest of the files must
consist only of declarations that logically nest within the
program. References to objects shared between separately
compiled files are allowed if the objects are declared in
included header files, whose names must end with .h. Header
files may only be included at the outermost level, and thus
declare only globally available objects. To allow functions
and procedures to be declared, an external directive has
been added, whose use is similar to the forward directive
but restricted to appear only in .h files. Function and
procedure bodies may not appear in .h files. A binding
phase of the compiler checks that declarations are used
consistently, to enforce the type-checking rules of Pascal.
Object files created by other language processors may be
loaded together with object files created by pc. The
functions and procedures they define must have been declared
in .h files included by all the .p files that call those
routines. Calling conventions are as in C, with var
parameters passed by address.
See the Pascal User Manual and Report for details.
OPTIONS
The following options have the same meaning as in cc(1) and
f77(1). See ld(1) for load-time options.
-c Suppress loading and produce .o file(s) from source
file(s).
-go Have the compiler produce additional symbol table
information for sdb(1).
-o output
Name the final output file output instead of a.out.
Printed 10/17/86 1
PC(1) COMMAND REFERENCE PC(1)
-p Prepare object files for profiling, see prof(1).
-pg Prepare object files for profiling, see gprof(1).
-w Suppress warning messages.
-O Invoke an object-code improver.
-S Compile the named program, and leave the assembler-
language output on the corresponding file suffixed .s.
(No .o is created.).
The following options are peculiar to pc.
-b Block buffer the file output.
-i Produce a listing for the specified procedures,
functions and include files.
-l Make a program listing during translation.
-s Accept standard Pascal only; nonstandard constructs
cause warning diagnostics.
-sc Make the compiler case insensitive, but allow all other
extensions.
-C Compile code to perform run-time checks, verify assert
statements, and initialize all variables to zero.
Other arguments are taken to be loader option arguments,
perhaps libraries of pc compatible routines. Certain flags
can also be controlled in comments within the program, as
described in the Berkeley Pascal User's Manual.
FILES
file.p Pascal source files
/usr/lib/pc0 compiler
/lib/f1 code generator
/usr/lib/pc2 run-time integrator (in-line
expander)
/lib/c2 peephole optimizer
/usr/lib/pc3 separate compilation consistency
checker
/usr/lib/pc2.0strings text of the error messages
Printed 10/17/86 2
PC(1) COMMAND REFERENCE PC(1)
/usr/lib/how_pc basic usage explanation
/usr/lib/libpc.a intrinsic functions and I/O library
/usr/lib/libm.a math library
/lib/libc.a standard library, see intro(3)
DIAGNOSTICS
For a basic explanation, do:
pc
In the diagnostic output of the translator, lines containing
syntax errors are listed with a flag indicating the point of
error. Diagnostic messages indicate the action that the
recovery mechanism took in order to be able to continue
parsing. Some diagnostics indicate only that the input is
"malformed". This occurs if the recovery can find no simple
correction to make the input syntactically valid.
Semantic error diagnostics indicate a line in the source
text near the point of error. Some errors evoke more than
one diagnostic to help pinpoint the error; the follow-up
messages begin with an ellipsis (...).
The first character of each error message indicates its
class:
E Fatal error; no code will be generated.
e Non-fatal error.
w Warning - a potential problem.
s Nonstandard Pascal construct warning.
Internal errors cause messages containing the word SNARK.
CAVEATS
The keyword packed is recognized but has no effect.
The binder is not as strict as described here, with regard
to the rules about external declarations only in .h files
and including .h files only at the outermost level. It is
made to perform these checks in its next incarnation, so
users are warned not to be sloppy.
Because the -s option is usurped by the compiler, it is not
possible to pass the strip option to the loader. Thus
programs that are to be stripped must be run through
strip(1) after they are compiled.
Printed 10/17/86 3
PC(1) COMMAND REFERENCE PC(1)
SEE ALSO
prof(1), sdb(1).
Printed 10/17/86 4
%%index%%
na:72,56;
sy:128,165;
de:293,2527;
op:2820,507;3471,1502;
fi:4973,601;5718,324;
di:6042,1121;
ca:7163,708;
se:8015,141;
%%index%%000000000153