PC(1) PC(1) NAME pc - Pascal compiler SYNOPSIS pc [ option ] [ -i name ... ] name ... DESCRIPTION _P_c is a Pascal compiler. If given an argument file ending with .p, it will compile the file and load it into an executable file called, by default, _a_._o_u_t. A program may be separated into more than one .p file. _P_c will compile 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_._o_u_t 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 which logically nest within the pro‐ gram. 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 out‐ ermost 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 _p_c. The functions and procedures they define must have been declared in .h files included by all the .p files which call those routines. Calling conventions are as in C, with var parameters passed by address. See the Berkeley Pascal User’s Manual for details. The following options have the same meaning as in _c_c(1) and _f_7_7(1). See _l_d(1) for load-time options. -c Suppress loading and produce ‘.o’ file(s) from source file(s). -g Have the compiler produce additional symbol table information for _d_b_x(1). -w Suppress warning messages. -p Prepare object files for profiling, see _p_r_o_f(1). -O Invoke an object-code improver. -S Compile the named program, and leave the assembler-language out‐ put on the corresponding file suffixed ‘.s’. (No ‘.o’ is cre‐ ated.). -o output Name the final output file _o_u_t_p_u_t instead of _a_._o_u_t_. The following options are peculiar to _p_c. -C Compile code to perform runtime checks, verify assert calls, and initialize all variables to zero as in _p_i. -b Block buffer the file _o_u_t_p_u_t_. -i Produce a listing for the specified procedures, functions and include files. -l Make a program listing during translation. -s Accept standard Pascal only; non-standard constructs cause warn‐ ing diagnostics. -t directory Use the given _d_i_r_e_c_t_o_r_y for compiler temporary files. -z Allow execution profiling with _p_x_p by generating statement coun‐ ters, and arranging for the creation of the profile data file _p_m_o_n_._o_u_t when the resulting object is executed. Other arguments are taken to be loader option arguments, perhaps libraries of _p_c compatible routines. Certain flags can also be con‐ trolled in comments within the program as described in the _B_e_r_k_e_l_e_y _P_a_s_c_a_l _U_s_e_r_’_s _M_a_n_u_a_l_. FILES file.p pascal source files /usr/lib/pc0 compiler /lib/f1 code generator /usr/lib/pc2 runtime integrator (inline expander) /lib/c2 peephole optimizer /usr/lib/pc3 separate compilation consistency checker /usr/lib/pc2.*strings text of the error messages /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 _i_n_t_r_o(3) SEE ALSO Berkeley Pascal User’s Manual pi(1), pxp(1), pxref(1), sdb(1) DIAGNOSTICS For a basic explanation do pc See _p_i(1). for an explanation of the error message format. Internal errors cause messages containing the word SNARK. AUTHORS Charles B. Haley, William N. Joy, and Ken Thompson Retargetted to the second pass of the portable _C compiler by Peter Kessler Runtime library and inline optimizer by M. Kirk McKusick Separate compilation consistency checking by Louise Madrid BUGS 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 will be made to perform these checks in its next incarnation, so users are warned not to be sloppy. The -z flag doesn’t work for separately compiled files. Because the -s option is usurped 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 _s_t_r_i_p(1) after they are compiled. 4th Berkeley Distribution April 29, 1985 PC(1)