1.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)pc.1 6.3 (Berkeley) 03/14/91 7.\" 8.Vx 9.Vx 10.Dd 11.Dt PC 1 12.Os BSD 4 13.Sh NAME 14.Nm pc 15.Nd Pascal compiler 16.Sh SYNOPSIS 17.Nm pc 18.Op option 19.Op Fl i Ar name \&... 20.Ar name \&... 21.Sh DESCRIPTION 22.Nm Pc 23is a Pascal compiler. 24If given an argument file ending with 25.Pa \&.p , 26it will compile the file 27and load it 28into an executable file called, by default, 29.Pa a.out . 30.Pp 31A program may be separated into more than one 32.Pa \&.p 33file. 34.Nm Pc 35will compile a number of argument 36.Pa \&.p 37files into object files (with 38the extension 39.Pa \&.o 40in place of 41.Pa \&.p ) . 42Object files may then be loaded 43into an executable 44.Pa a.out 45file. 46Exactly one object file must supply a 47.Ar program 48statement to successfully create an executable a.out file. 49The rest of the files must consist only of 50declarations which logically nest within the program. 51References to objects shared between separately compiled files 52are allowed if the objects are declared in 53.Ic included 54header files, whose names must end with 55.Pa \&.h . 56Header files may only be included at the outermost level, 57and thus declare only globally available objects. 58To allow 59.Cx Ic function 60.Cx s 61.Cx 62and 63.Cx Ic procedure 64.Cx s 65.Cx 66to be declared, an 67.Ic external 68directive has been added, whose use is similar to the 69.Ic forward 70directive but restricted to appear only in 71.Pa \&.h 72files. 73.Ic Function 74and 75.Ic procedure 76bodies may not appear in 77.Pa \&.h 78files. 79A binding phase of the compiler checks that declarations 80are used consistently, to enforce the type checking rules of Pascal. 81.Pp 82Object files 83created by other language processors may be loaded together with 84object files created by 85.Nm pc . 86The 87.Cx Ic function 88.Cx s 89.Cx 90and 91.Cx Ic procedure 92.Cx s 93.Cx 94they define must have been declared 95in 96.Pa \&.h 97files included by all the 98.Pa \&.p 99files which call those 100routines. 101Calling conventions are as in C, 102with 103.Ic var 104parameters passed by address. 105.Pp 106See the Berkeley Pascal User's Manual for details. 107.Pp 108The following options have the same meaning as in 109.Xr cc 1 110and 111.Xr f77 1 . 112See 113.Xr ld 1 114for load-time options. 115.Tw Fl 116.Tp Fl c 117Suppress loading and produce `.o' file(s) from source file(s). 118.Tp Fl g 119Have the compiler produce additional symbol table information for 120.Xr dbx 1 . 121.Tp Fl w 122Suppress warning messages. 123.Tp Fl p 124Prepare object files for profiling, see 125.Xr prof 1 . 126.Tp Fl O 127Invoke an 128object-code improver. 129.Tp Fl S 130Compile the named program, and leave the 131assembler-language output on the corresponding file suffixed `.s'. 132(No `.o' is created.). 133.Tp Cx Fl o 134.Ws 135.Ar output 136.Cx 137Name the final output file 138.Ar output 139instead of 140.Pa a.out . 141.Tp 142.Pp 143The following options are peculiar to 144.Nm pc . 145.Tw Fl 146.Tp Fl C 147Compile code to perform runtime checks, 148verify 149.Ic assert 150calls, 151and initialize all variables to zero as in 152.Nm pi . 153.Tp Fl b 154Block buffer the file 155.Ar output . 156.Tp Fl i 157Produce a listing for 158the specified procedures, functions and 159.Ar include 160files. 161.Tp Fl l 162Make a program listing during translation. 163.Tp Fl s 164Accept standard Pascal only; 165non-standard constructs cause warning diagnostics. 166.Tp Cx Fl t 167.Ws 168.Ar directory 169.Cx 170Use the given 171.Ar directory 172for compiler temporary files. 173.Tp Fl z 174Allow execution profiling with 175.Nm pxp 176by generating statement counters, and arranging for the 177creation of the profile data file 178.Pa pmon.out 179when the resulting object is executed. 180.Pp 181.Tp 182Other arguments 183are taken 184to be loader option arguments, 185perhaps libraries of 186.Nm pc 187compatible routines. 188Certain flags can also be controlled in comments within the program 189as described in the 190.Em "Berkeley Pascal User's Manual." 191.Sh FILES 192.Dw /usr/lib.pc2.*strings 193.Di L 194.Dp Pa file.p 195pascal source files 196.Dp Pa /usr/lib/pc0 197compiler 198.Dp Pa /lib/f1 199code generator 200.Dp Pa /usr/lib/pc2 201runtime integrator (inline expander) 202.Dp Pa /lib/c2 203peephole optimizer 204.Dp Pa /usr/lib/pc3 205separate compilation consistency checker 206.Dp Pa /usr/lib/pc2.*strings 207text of the error messages 208.Dp Pa /usr/lib/how_pc 209basic usage explanation 210.Dp Pa /usr/lib/libpc.a 211intrinsic functions and I/O library 212.Dp Pa /usr/lib/libm.a 213math library 214.Dp Pa /lib/libc.a 215standard library, see 216.Xr intro 3 217.Dp 218.Sh SEE ALSO 219.Em Berkeley Pascal User's Manual 220.br 221.Xr pi 1 , 222.Xr pxp 1 , 223.Xr pxref 1 , 224.\" .Xr sdb 1 225.Sh HISTORY 226.Nm Pc 227appeared in 4.0 BSD. 228.Sh DIAGNOSTICS 229For a basic explanation do 230.Pp 231.Df I 232.Nm pc 233.De 234.Pp 235See 236.Xr pi 1 . 237for an explanation of the error message format. 238Internal errors cause messages containing the word SNARK. 239.Sh AUTHORS 240Charles B. Haley, William N. Joy, and Ken Thompson 241.br 242Retargetted to the second pass of the portable 243.Ar C 244compiler by Peter Kessler 245.br 246Runtime library and inline optimizer by M. Kirk McKusick 247.br 248Separate compilation consistency checking by Louise Madrid 249.Sh BUGS 250The keyword 251.Ic packed 252is recognized but has no effect. 253.Pp 254The binder is not as strict as described here, 255with regard to the rules about external declarations only 256in `.h' files and including `.h' files only at the outermost level. 257It will be made to perform these checks in its next incarnation, 258so users are warned not to be sloppy. 259.Pp 260The 261.Fl z 262flag doesn't work for separately compiled files. 263.Pp 264Because the 265.Fl s 266option is usurped by the compiler, 267it is not possible to pass the strip option to the loader. 268Thus programs which are to be stripped, must be run through 269.Xr strip 1 270after they are compiled. 271