1*43083Scael.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2*43083Scael.\" All rights reserved. 319242Smckusick.\" 4*43083Scael.\" %sccs.include.redist.man% 519242Smckusick.\" 6*43083Scael.\" @(#)pc.1 6.2 (Berkeley) 06/11/90 7*43083Scael.\" 8*43083Scael.Dd 9*43083Scael.Dt PC 1 10*43083Scael.Os BSD 4 11*43083Scael.Sh NAME 12*43083Scael.Nm pc 13*43083Scael.Nd Pascal compiler 14*43083Scael.Sh SYNOPSIS 15*43083Scael.Nm pc 16*43083Scael.Op option 17*43083Scael.Op Fl i Ar name \&... 18*43083Scael.Ar name \&... 19*43083Scael.Sh DESCRIPTION 20*43083Scael.Nm Pc 2119242Smckusickis a Pascal compiler. 2219242SmckusickIf given an argument file ending with 23*43083Scael.Pa \&.p , 24*43083Scaelit will compile the file 2519242Smckusickand load it 2619242Smckusickinto an executable file called, by default, 27*43083Scael.Pa a.out . 28*43083Scael.Pp 29*43083ScaelA program may be separated into more than one 30*43083Scael.Pa \&.p 3119242Smckusickfile. 32*43083Scael.Nm Pc 3319242Smckusickwill compile a number of argument 34*43083Scael.Pa \&.p 3519242Smckusickfiles into object files (with 3619242Smckusickthe extension 37*43083Scael.Pa \&.o 3819242Smckusickin place of 39*43083Scael.Pa \&.p ) . 40*43083ScaelObject files may then be loaded 4119242Smckusickinto an executable 42*43083Scael.Pa a.out 4319242Smckusickfile. 44*43083ScaelExactly one object file must supply a 45*43083Scael.Ar program 4619242Smckusickstatement to successfully create an executable a.out file. 47*43083ScaelThe 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 51*43083Scael.Ic included 5219242Smckusickheader files, whose names must end with 53*43083Scael.Pa \&.h . 5419242SmckusickHeader files may only be included at the outermost level, 5519242Smckusickand thus declare only globally available objects. 5619242SmckusickTo allow 57*43083Scael.Cx Ic function 58*43083Scael.Cx s 59*43083Scael.Cx 6019242Smckusickand 61*43083Scael.Cx Ic procedure 62*43083Scael.Cx s 63*43083Scael.Cx 6419242Smckusickto be declared, an 65*43083Scael.Ic external 6619242Smckusickdirective has been added, whose use is similar to the 67*43083Scael.Ic forward 6819242Smckusickdirective but restricted to appear only in 69*43083Scael.Pa \&.h 7019242Smckusickfiles. 71*43083Scael.Ic Function 72*43083Scaeland 73*43083Scael.Ic procedure 7419242Smckusickbodies may not appear in 75*43083Scael.Pa \&.h 7619242Smckusickfiles. 7719242SmckusickA binding phase of the compiler checks that declarations 7819242Smckusickare used consistently, to enforce the type checking rules of Pascal. 79*43083Scael.Pp 80*43083ScaelObject files 8119242Smckusickcreated by other language processors may be loaded together with 82*43083Scaelobject files created by 83*43083Scael.Nm pc . 8419242SmckusickThe 85*43083Scael.Cx Ic function 86*43083Scael.Cx s 87*43083Scael.Cx 8819242Smckusickand 89*43083Scael.Cx Ic procedure 90*43083Scael.Cx s 91*43083Scael.Cx 9219242Smckusickthey define must have been declared 9319242Smckusickin 94*43083Scael.Pa \&.h 9519242Smckusickfiles included by all the 96*43083Scael.Pa \&.p 9719242Smckusickfiles which call those 9819242Smckusickroutines. 9919242SmckusickCalling conventions are as in C, 10019242Smckusickwith 101*43083Scael.Ic var 10219242Smckusickparameters passed by address. 103*43083Scael.Pp 10419242SmckusickSee the Berkeley Pascal User's Manual for details. 105*43083Scael.Pp 10619242SmckusickThe following options have the same meaning as in 107*43083Scael.Xr cc 1 10819242Smckusickand 109*43083Scael.Xr f77 1 . 11019242SmckusickSee 111*43083Scael.Xr ld 1 11219242Smckusickfor load-time options. 113*43083Scael.Tw Fl 114*43083Scael.Tp Fl c 11519242SmckusickSuppress loading and produce `.o' file(s) from source file(s). 116*43083Scael.Tp Fl g 11719242SmckusickHave the compiler produce additional symbol table information for 118*43083Scael.Xr dbx 1 . 119*43083Scael.Tp Fl w 12019242SmckusickSuppress warning messages. 121*43083Scael.Tp Fl p 12219242SmckusickPrepare object files for profiling, see 123*43083Scael.Xr prof 1 . 124*43083Scael.Tp Fl O 12519242SmckusickInvoke an 12619242Smckusickobject-code improver. 127*43083Scael.Tp Fl S 12819242SmckusickCompile the named program, and leave the 12919242Smckusickassembler-language output on the corresponding file suffixed `.s'. 13019242Smckusick(No `.o' is created.). 131*43083Scael.Tp Cx Fl o 132*43083Scael.Ws 133*43083Scael.Ar output 134*43083Scael.Cx 13519242SmckusickName the final output file 136*43083Scael.Ar output 13719242Smckusickinstead of 138*43083Scael.Pa a.out . 139*43083Scael.Tp 140*43083Scael.Pp 14119242SmckusickThe following options are peculiar to 142*43083Scael.Nm pc . 143*43083Scael.Tw Fl 144*43083Scael.Tp Fl C 14519242SmckusickCompile code to perform runtime checks, 14619242Smckusickverify 147*43083Scael.Ic assert 14819243Smckusickcalls, 14919242Smckusickand initialize all variables to zero as in 150*43083Scael.Nm pi . 151*43083Scael.Tp Fl b 15219242SmckusickBlock buffer the file 153*43083Scael.Ar output . 154*43083Scael.Tp Fl i 15519242SmckusickProduce a listing for 15619242Smckusickthe specified procedures, functions and 157*43083Scael.Ar include 15819242Smckusickfiles. 159*43083Scael.Tp Fl l 16019242SmckusickMake a program listing during translation. 161*43083Scael.Tp Fl s 16219242SmckusickAccept standard Pascal only; 16319242Smckusicknon-standard constructs cause warning diagnostics. 164*43083Scael.Tp Cx Fl t 165*43083Scael.Ws 166*43083Scael.Ar directory 167*43083Scael.Cx 16819243SmckusickUse the given 169*43083Scael.Ar directory 17019243Smckusickfor compiler temporary files. 171*43083Scael.Tp Fl z 17219242SmckusickAllow execution profiling with 173*43083Scael.Nm pxp 17419242Smckusickby generating statement counters, and arranging for the 17519242Smckusickcreation of the profile data file 176*43083Scael.Pa pmon.out 17719242Smckusickwhen the resulting object is executed. 178*43083Scael.Pp 179*43083Scael.Tp 18019242SmckusickOther arguments 18119242Smckusickare taken 18219242Smckusickto be loader option arguments, 18319242Smckusickperhaps libraries of 184*43083Scael.Nm pc 18519242Smckusickcompatible routines. 18619242SmckusickCertain flags can also be controlled in comments within the program 18719242Smckusickas described in the 188*43083Scael.Em "Berkeley Pascal User's Manual." 189*43083Scael.Sh FILES 190*43083Scael.Dw /usr/lib.pc2.*strings 191*43083Scael.Di L 192*43083Scael.Dp Pa file.p 193*43083Scaelpascal source files 194*43083Scael.Dp Pa /usr/lib/pc0 195*43083Scaelcompiler 196*43083Scael.Dp Pa /lib/f1 197*43083Scaelcode generator 198*43083Scael.Dp Pa /usr/lib/pc2 199*43083Scaelruntime integrator (inline expander) 200*43083Scael.Dp Pa /lib/c2 201*43083Scaelpeephole optimizer 202*43083Scael.Dp Pa /usr/lib/pc3 203*43083Scaelseparate compilation consistency checker 204*43083Scael.Dp Pa /usr/lib/pc2.*strings 205*43083Scaeltext of the error messages 206*43083Scael.Dp Pa /usr/lib/how_pc 207*43083Scaelbasic usage explanation 208*43083Scael.Dp Pa /usr/lib/libpc.a 209*43083Scaelintrinsic functions and I/O library 210*43083Scael.Dp Pa /usr/lib/libm.a 211*43083Scaelmath library 212*43083Scael.Dp Pa /lib/libc.a 213*43083Scaelstandard library, see 214*43083Scael.Xr intro 3 215*43083Scael.Dp 216*43083Scael.Sh SEE ALSO 217*43083Scael.Em Berkeley Pascal User's Manual 21819242Smckusick.br 219*43083Scael.Xr pi 1 , 220*43083Scael.Xr pxp 1 , 221*43083Scael.Xr pxref 1 , 222*43083Scael.\" .Xr sdb 1 223*43083Scael.Sh HISTORY 224*43083Scael.Nm Pc 225*43083Scaelappeared in 4.0 BSD. 226*43083Scael.Sh DIAGNOSTICS 22719242SmckusickFor a basic explanation do 228*43083Scael.Pp 229*43083Scael.Df I 230*43083Scael.Nm pc 231*43083Scael.De 232*43083Scael.Pp 233*43083ScaelSee 234*43083Scael.Xr pi 1 . 23519242Smckusickfor an explanation of the error message format. 23619242SmckusickInternal errors cause messages containing the word SNARK. 237*43083Scael.Sh AUTHORS 23819242SmckusickCharles B. Haley, William N. Joy, and Ken Thompson 23919242Smckusick.br 24019242SmckusickRetargetted to the second pass of the portable 241*43083Scael.Ar C 24219242Smckusickcompiler by Peter Kessler 24319242Smckusick.br 24419242SmckusickRuntime library and inline optimizer by M. Kirk McKusick 24519242Smckusick.br 24619242SmckusickSeparate compilation consistency checking by Louise Madrid 247*43083Scael.Sh BUGS 24819242SmckusickThe keyword 249*43083Scael.Ic packed 25019242Smckusickis recognized but has no effect. 251*43083Scael.Pp 25219242SmckusickThe binder is not as strict as described here, 25319242Smckusickwith regard to the rules about external declarations only 25419242Smckusickin `.h' files and including `.h' files only at the outermost level. 25519242SmckusickIt will be made to perform these checks in its next incarnation, 25619242Smckusickso users are warned not to be sloppy. 257*43083Scael.Pp 25819242SmckusickThe 259*43083Scael.Fl z 26019242Smckusickflag doesn't work for separately compiled files. 261*43083Scael.Pp 26219242SmckusickBecause the 263*43083Scael.Fl s 26419242Smckusickoption is usurped by the compiler, 26519242Smckusickit is not possible to pass the strip option to the loader. 266*43083ScaelThus programs which are to be stripped, must be run through 267*43083Scael.Xr strip 1 26819242Smckusickafter they are compiled. 269