xref: /csrg-svn/usr.bin/pascal/pc/pc.1 (revision 62106)
1*62106Sbostic.\" Copyright (c) 1980, 1990, 1993
2*62106Sbostic.\"	The Regents of the University of California.  All rights reserved.
319242Smckusick.\"
449611Scael.\" %sccs.include.redist.roff%
519242Smckusick.\"
6*62106Sbostic.\"     @(#)pc.1	8.1 (Berkeley) 06/06/93
743083Scael.\"
843083Scael.Dd
943083Scael.Dt PC 1
1043083Scael.Os BSD 4
1143083Scael.Sh NAME
1249611Scael.Nm \&pc
1343083Scael.Nd Pascal compiler
1443083Scael.Sh SYNOPSIS
1549611Scael.Nm \&pc
1643083Scael.Op  option
1743083Scael.Op Fl i Ar name \&...
1843083Scael.Ar name \&...
1943083Scael.Sh DESCRIPTION
2049611Scael.Nm \&Pc
2119242Smckusickis a Pascal compiler.
2219242SmckusickIf given an argument file ending with
2343083Scael.Pa \&.p ,
2443083Scaelit will compile the file
2519242Smckusickand load it
2619242Smckusickinto an executable file called, by default,
2743083Scael.Pa a.out  .
2843083Scael.Pp
2943083ScaelA program may be separated into more than one
3043083Scael.Pa \&.p
3119242Smckusickfile.
3249611Scael.Nm \&Pc
3319242Smckusickwill compile a number of argument
3443083Scael.Pa \&.p
3519242Smckusickfiles into object files (with
3619242Smckusickthe extension
3743083Scael.Pa \&.o
3819242Smckusickin place of
3943083Scael.Pa \&.p ) .
4043083ScaelObject files may then be loaded
4119242Smckusickinto an executable
4243083Scael.Pa a.out
4319242Smckusickfile.
4443083ScaelExactly one object file must supply a
4543083Scael.Ar program
4619242Smckusickstatement to successfully create an executable a.out file.
4743083ScaelThe rest of the files must consist only of
4819242Smckusickdeclarations which logically nest within the program.
4919242SmckusickReferences to objects shared between separately compiled files
5019242Smckusickare allowed if the objects are declared in
5143083Scael.Ic included
5219242Smckusickheader files, whose names must end with
5343083Scael.Pa \&.h .
5419242SmckusickHeader files may only be included at the outermost level,
5519242Smckusickand thus declare only globally available objects.
5619242SmckusickTo allow
5749611Scael.Ic function Ns s
5819242Smckusickand
5949611Scael.Ic procedure Ns s
6019242Smckusickto be declared, an
6143083Scael.Ic external
6219242Smckusickdirective has been added, whose use is similar to the
6343083Scael.Ic forward
6419242Smckusickdirective but restricted to appear only in
6543083Scael.Pa \&.h
6619242Smckusickfiles.
6743083Scael.Ic Function
6843083Scaeland
6943083Scael.Ic procedure
7019242Smckusickbodies may not appear in
7143083Scael.Pa \&.h
7219242Smckusickfiles.
7319242SmckusickA binding phase of the compiler checks that declarations
7419242Smckusickare used consistently, to enforce the type checking rules of Pascal.
7543083Scael.Pp
7643083ScaelObject files
7719242Smckusickcreated by other language processors may be loaded together with
7843083Scaelobject files created by
7949611Scael.Nm \&pc  .
8019242SmckusickThe
8149611Scael.Ic function Ns s
8219242Smckusickand
8349611Scael.Ic procedure Ns s
8419242Smckusickthey define must have been declared
8519242Smckusickin
8643083Scael.Pa \&.h
8719242Smckusickfiles included by all the
8843083Scael.Pa \&.p
8919242Smckusickfiles which call those
9019242Smckusickroutines.
9119242SmckusickCalling conventions are as in C,
9219242Smckusickwith
9343083Scael.Ic var
9419242Smckusickparameters passed by address.
9543083Scael.Pp
9649611ScaelSee the
9749611Scael.%T "Berkeley Pascal User's Manual"
9849611Scaelfor details.
9943083Scael.Pp
10019242SmckusickThe following options have the same meaning as in
10143083Scael.Xr cc  1
10219242Smckusickand
10343083Scael.Xr f77  1  .
10419242SmckusickSee
10549611Scael.Xr \&ld  1
10619242Smckusickfor load-time options.
10749611Scael.Bl -tag -width indent
10849611Scael.It Fl c
10919242SmckusickSuppress loading and produce `.o' file(s) from source file(s).
11049611Scael.It Fl g
11119242SmckusickHave the compiler produce additional symbol table information for
11243083Scael.Xr dbx  1  .
11349611Scael.It Fl w
11419242SmckusickSuppress warning messages.
11549611Scael.It Fl p
11619242SmckusickPrepare object files for profiling, see
11743083Scael.Xr prof  1  .
11849611Scael.It Fl O
11919242SmckusickInvoke an
12019242Smckusickobject-code improver.
12149611Scael.It Fl S
12219242SmckusickCompile the named program, and leave the
12319242Smckusickassembler-language output on the corresponding file suffixed `.s'.
12419242Smckusick(No `.o' is created.).
12549611Scael.It Fl o Ns Ar output
12619242SmckusickName the final output file
12743083Scael.Ar output
12819242Smckusickinstead of
12943083Scael.Pa a.out .
13049611Scael.El
13143083Scael.Pp
13219242SmckusickThe following options are peculiar to
13343083Scael.Nm pc  .
13449611Scael.Bl -tag -width indent
13549611Scael.It Fl C
13619242SmckusickCompile code to perform runtime checks,
13719242Smckusickverify
13843083Scael.Ic assert
13919243Smckusickcalls,
14019242Smckusickand initialize all variables to zero as in
14143083Scael.Nm pi  .
14249611Scael.It Fl b
14319242SmckusickBlock buffer the file
14443083Scael.Ar output .
14549611Scael.It Fl i
14619242SmckusickProduce a listing for
14719242Smckusickthe specified procedures, functions and
14843083Scael.Ar include
14919242Smckusickfiles.
15049611Scael.It Fl l
15119242SmckusickMake a program listing during translation.
15249611Scael.It Fl s
15319242SmckusickAccept standard Pascal only;
15419242Smckusicknon-standard constructs cause warning diagnostics.
15549611Scael.It Fl t Ar directory
15619243SmckusickUse the given
15743083Scael.Ar directory
15819243Smckusickfor compiler temporary files.
15949611Scael.It Fl z
16019242SmckusickAllow execution profiling with
16143083Scael.Nm pxp
16219242Smckusickby generating statement counters, and arranging for the
16319242Smckusickcreation of the profile data file
16443083Scael.Pa pmon.out
16519242Smckusickwhen the resulting object is executed.
16649611Scael.El
16743083Scael.Pp
16819242SmckusickOther arguments
16919242Smckusickare taken
17019242Smckusickto be loader option arguments,
17119242Smckusickperhaps libraries of
17249611Scael.Nm \&pc
17319242Smckusickcompatible routines.
17419242SmckusickCertain flags can also be controlled in comments within the program
17519242Smckusickas described in the
17649611Scael.%T "Berkeley Pascal User's Manual."
17743083Scael.Sh FILES
17849611Scael.Bl -tag -width /usr/lib.pc2.*strings -compact
17949611Scael.It Pa file.p
18049611ScaelPascal source files.
18149611Scael.It Pa /usr/lib/pc0
18249611ScaelCompiler.
18349611Scael.It Pa /lib/f1
18449611ScaelCode generator.
18549611Scael.It Pa /usr/lib/pc2
18649611ScaelRuntime integrator (inline expander).
18749611Scael.It Pa /lib/c2
18849611ScaelPeephole optimizer.
18949611Scael.It Pa /usr/lib/pc3
19049611ScaelSeparate compilation consistency checker.
19149611Scael.It Pa /usr/lib/pc2.*strings
19249611ScaelText of the error messages.
19349611Scael.It Pa /usr/lib/how_pc
19449611ScaelBasic usage explanation.
19549611Scael.It Pa /usr/lib/libpc.a
19649611ScaelIntrinsic functions and
19749611Scael.Tn I/O
19849611Scaellibrary.
19949611Scael.It Pa /usr/lib/libm.a
20049611ScaelMath library.
20149611Scael.It Pa /lib/libc.a
20249611ScaelStandard library, see
20349611Scael.Xr intro 3 .
20449611Scael.El
20543083Scael.Sh SEE ALSO
20649611Scael.Xr \&pi 1 ,
20743083Scael.Xr pxp 1 ,
20843083Scael.Xr pxref 1 ,
20949611Scael.Rs
21049611Scael.%T "Berkeley Pascal User's Manual"
21149611Scael.Re
21243083Scael.Sh HISTORY
21349611ScaelThe
21449611Scael.Nm \&pc
21549611Scaelappeared in
21649611Scael.Bx 4.0 .
21743083Scael.Sh DIAGNOSTICS
21819242SmckusickFor a basic explanation do
21943083Scael.Pp
22049611Scael.Bd -literal -offset indent
22149611Scaelpc
22249611Scael.Ed
22343083Scael.Pp
22443083ScaelSee
22549611Scael.Xr \&pi 1  .
22619242Smckusickfor an explanation of the error message format.
22749611ScaelInternal errors cause messages containing the word
22849611Scael.Tn SNARK .
22943083Scael.Sh BUGS
23019242SmckusickThe keyword
23143083Scael.Ic packed
23219242Smckusickis recognized but has no effect.
23343083Scael.Pp
23419242SmckusickThe binder is not as strict as described here,
23519242Smckusickwith regard to the rules about external declarations only
23619242Smckusickin `.h' files and including `.h' files only at the outermost level.
23719242SmckusickIt will be made to perform these checks in its next incarnation,
23819242Smckusickso users are warned not to be sloppy.
23943083Scael.Pp
24019242SmckusickThe
24143083Scael.Fl z
24219242Smckusickflag doesn't work for separately compiled files.
24343083Scael.Pp
24419242SmckusickBecause the
24543083Scael.Fl s
24619242Smckusickoption is usurped by the compiler,
24719242Smckusickit is not possible to pass the strip option to the loader.
24843083ScaelThus programs which are to be stripped, must be run through
24943083Scael.Xr strip  1
25019242Smckusickafter they are compiled.
251