Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pindent(1)

PC(1)  —  USER COMMANDS

NAME

pc − Pascal compiler

SYNOPSIS

pc [ −a ] [ −align _block ] [ −b ] [ −B binding ] [ −c ] [ −cond ] [ −config variable ] [ −C ] [ −dryrun ]

[ −Dname[=def ] ] [ −ffloat_option ] [ −g ] [ −G ] [ −help ] [ −H ] [ −i name ] [ −I pathname ]

[ −J ] [ −l ] [ −l lib ] [ −lpfc ] [ −L ] [ −misalign ] [ −o object_file ] [ −O[level] ] [ −p ] [ −pg ]

[ −pic ] [ −pipe ] [ −P ] [ −PIC ] [ −Qoption prog opt ] [ −Qpath pathname ]

[ −Qproduce sourcetype ] [ −R ] [ −s[level] ] [ −S ] [ −t ] [ −temp=dir ] [ −time ] [ −U name ]

[ −v ] [ −V[level] ] [ −w ] [ −xl ] [ −Z ] sourcefile ...

DESCRIPTION

pc is the Sun Pascal compiler.  If given an argument file ending with .p (or .pas), pc compiles the file and leaves the result in an executable file, called a.out by default. 

A program may be separated into multiple .p (or .pas) files.  pc compiles a number of .p (or .pas) files into object files (with the extension .o in place of .p or .pas).  Object files may then be linked into an executable file.  Exactly one object file must supply a program statement to successfully create an executable file.  The rest of the files must consist only of declarations which logically nest within the program. 

Object files created by other language processors may be linked together with object files created by pc.  The functions and procedures they define must have been declared by all the .p (or .pas) files which call those routines using the extern, external, or nonpascal routine options. 

pc supports ISO Level 0 and Level 1 standard Pascal, including conformant array parameters. 

See the Sun Pascal User’s Guide for details. 

OPTIONS

−a Insert code to count how many times each basic block is executed.  See tcov(1). 

−align  _block
Cause the global symbol whose Pascal name is block to be page-aligned: its size is increased to a whole number of pages and its first byte is placed at the beginning of a page. 

−b Turn on block-buffering with a block size of 1024. 

−Bbinding Specify whether bindings of libraries for linking are static or dynamic, indicating whether libraries are non-shared or shared, respectively. 

−c Suppress linking with ld(1) and produce a .o file for each source file. 

−cond Compile the lines in your program that begin with the %debug directive. 

−config variable
Define the conditional variable whose name is variable for the preprocessor cppas.  When you use −config, you must declare variable in your program with the %var directive. 

−C Compile code to perform subscript, subrange, and other checks, and verify assert statements.  Note that pointers are not checked.  This option differs significantly from the -C option of the cc compiler. 

−dryrun Show but do not execute the commands constructed by the compilation driver. 

−Dname[=def ]
Define a symbol name to the preprocessor cpp(1).  Equivalent to a #define statement in the source.  If no def is given, name is defined as ‘1’. 

−ffloat_option
Floating-point code generation option. This option cannot be used on a Sun-4 or Sun386i system.  On Sun-3 systems, it can be one of:

−f68881In-line code for the Motorola 68881 floating-point processor. 

−ffpaIn−line code for the Sun Floating Point Accelerator. 

−fsoftSoftware floating-point calls.  This is the default. 

−fswitchRuntime switched floating-point calls.  The compiled object code is linked at runtime to routines that support one of the above types of floating-point code.  This was the default in some previous releases.  Only for use with programs that are floating-point intensive and that must be portable to machines with various floating-point options. 

−g Produce additional symbol table information for dbx(1) and dbxtool(1) and pass the −lg flag to ld(1). 

−G Generate pc3 stab information.  This option enforces the rules of separate compilation used in the Sun Pascal 1.1 compiler. 

−help Display helpful information about pc. 

−H Compile code to perform range checking on pointers into the heap. 

−i name Produce a listing for the specified procedure, function, #include or %include files. 

−I pathname Add pathname to the list of directories in which to search for #include and %include files with relative filenames (not beginning with /).  The preprocessor first searches for #include and %include files in the directory containing sourcefile, then in directories named with −I options (if any), and, finally, in /usr/include . 

−J Generate 32-bit offsets in switch/case statement labels.  This option applies to the Sun-3 Workstation only. 

−l Make a program listing during translation. 

−l lib Link with object library lib (for ld(1)). 

−lpfc Link with common startup code for programs containing mixed Pascal and FORTRAN object files.  Such programs should also be linked with the FORTRAN libraries (see FILES below). 

−L Map all identifiers and keywords to lower case. 

−misalign Allow for misaligned data in memory (Sun-4 only). 

−o object_file
Name the object file object_file.  object_file must have the appropriate suffix for the type of file to be produced by the compilation (see FILES, below).  object_file cannot be the same as the source file; the compiler will not overwrite the source file. 

−O[level] Optimize the object code.  Ignored when −g is used.  level is one of:

1 Do postpass assembly-level optimization only. 

2 Do global optimization prior to code generation, including loop optimizations, common subexpression elimination, copy propagation, and automatic register allocation.  −O2 does not optimize references to  or definitions of external or indirect variables.  This is the default. 

3 Same as −O2, but optimize uses and definitions of external variables.  −O3 does not trace the  effects  of  pointer assignments.  Neither −O3 nor −O4 should be used when compiling either device drivers or programs that modify external variables from within signal handlers. 

4 Same as −O3, but trace  the  effects  of pointer assignments. 

−O without a level number is the same as −O2.  Levels 3 and 4 are not recommended because of the extreme increase in compilation time and relatively minor improvement over -O2 in runtime performance (for most programs). 

−p Prepare the object code to collect data for profiling with prof(1).  Invokes a run-time recording mechanism that produces a mon.out file (at normal termination). 

−pg Prepare the object code to collect data for profiling with gprof(1).  Invokes a run-time recording mechanism that produces a gmon.out file (at normal termination). 

−pic Generate position independent (PIC) code. 

−pipe Use pipes, rather than intermediate files, between compilation stages.  This option is CPU-intensive. 

−P Use partial evaluation semantics for the boolean operators and and or.  For these operators only, left-to-right evaluation is guaranteed, and the second operand is evaluated only if necessary to determine the result. 

−PIC Generate position independent (PIC) code. 

−Qoption prog opt
Pass the option opt to the program prog.  The option must be appropriate to that program and may begin with a plus or minus sign.  prog can be one of: as, c2, cpp, cppas inline, iropt, ld, pc0, or pc3. 

−Qpath pathname
Insert directory pathname into the compilation search path (to use alternative versions of programs invoked during compilation).  This path will also be searched first for certain relocatable object files that are implicitly referenced by the compilation driver. 

−Qproduce sourcetype
Produce source code of the type sourcetype. sourcetype can be one of:

.pi Preprocessed Pascal source from cpp(1).

.o Object file from as(1).

.s Assembler source (from c2 or inline|). 

−R Assemble with the −R flag, which merges the data segment with the text segment.  See as(1) for more information. 

−s[level] Accept standard Pascal only;  nonstandard constructs and extensions cause warning diagnostics.  Sun Pascal has two levels of compliance with standard Pascal:  Level 0 and Level 1.  The level can be one of:

−s Accept Level 1 compliance with standard Pascal. 

−s0 Accept Level 0 compliance with standard Pascal. 

−s1 Same as −s. 

This option also performs the action of −L that is, it maps all upper case letters in keywords and identifiers to lower case. 

−S Compile the named program, and leave the assembly language output on the corresponding file suffixed .s.  No .o file is created. 

−t Pass the program to the linker for verbose messages. 

−temp=dir Set directory for temporary files to be dir. 

−time Report execution times for the various compilation passes. 

−U name Remove any initial definition of the cpp(1) symbol name.  (Inverse of the −D option.) 

−v Verbose.  Print the name of each program it compiles. 

−V[level] Invoke a series of options, depending on the level:

−V0 Equivalent to −C, −H, −L, and −s0. 

−V1 Equivalent to −C, −H, −L, and −s1. 

−w Suppress warning messages. 

−xl Implement the extended language features of Sun Pascal.  These include the following:

•Default integer size of 16 bits. 

•Default real size of 32 bits. 

•Default enumerated type size of 16 bits. 

•Run source file through the preprocesser /usr/ucb/cppas before processing it by the Pascal front-end. 

•Support nonpascal as a routine option. 

•Turn on −L option by default. 

•Set the default writing of enumerated and boolean variables to uppercase and 15-character width format. 

•Do not generate an error if the value of the expression in a case statement does not match any of the case values. 

•Do not generate an error when integer or real constant literals overflow implementation limits. 

•Do not generate a warning when the argument to the addr function is a local or private variable. 

•Set the default visibility for top-level variables, procedures, and functions in programs to private. 

•Set the default visibility for top-level variables in modules to private and for top-level, procedures, and functions in modules to public. 

•Modules compiled with −xl are not compatible with modules compiled without −xl. 

−Z Initialize local variables to zero. 

Other arguments are taken to be linker option arguments or libraries of pc-compatible routines.  Certain flags can also be controlled by comments within the program, as described in the Sun Pascal User’s Guide. 

FILES

a.out executable output file

file.a library of object files

file.d tcov(1) test coverage input file

file.il inline expansion file

file.o object file

file.p Pascal source file

file.pas Pascal source file

file.pi Pascal source after preprocessing with cpp(1)

file.s assembler source file

file.S assembler source for cpp(1)

file.tcov output from tcov(1)

/lib/cpp Sun C preprocessor

/lib/crt0.o runtime startup

/lib/gcrt0.o startup for profiling with gprof(1)

/lib/libc.a standard library, see intro(3)

/lib/mcrt0.o startup for profiling with prof(1)

/usr/bin/pascal/as assembler

/usr/include standard directory for #include files

/usr/include/pascal/unixio.h
standard #include file

/usr/include/pascal/unixio.i
standard #include file

/usr/include/pascal/ioerr.h
standard #include file

/usr/lib/libc_p.a profiling library, see intro(3)

/usr/lib/libm.a math library

/usr/lib/libpc.a intrinsic functions and Pascal I/O library

/usr/lib/libpc.so.2.0 shared library

/usr/lib/libpfc.a startup code for combined Pascal and FORTRAN 77 programs

/usr/lib/libpfc_p.a profiling library for combined Pascal and FORTRAN 77 programs

/usr/lib/pascal/c2 object code optimizer for Sun-3

/usr/lib/pascal/cg code generator

/usr/lib/pascal/inline inline expander of library calls

/usr/lib/pascal/iropt object code optimizer

/usr/lib/pc0 compiler front end

/usr/lib/pc3 separate compilation consistency checker

/usr/lib/pascal/optim object code optimizer for Sun386i

/usr/lib/pcexterns.o external definitions

/usr/man/man1/pc.1 manual page

/usr/man/man1/pindent.1
manual page

/usr/ucb/cppas Sun Pascal preprocessor

/usr/ucb/pascal/dbx debugger

/usr/ucb/pc compiler command-line processing driver for Pascal

/usr/ucb/pindent Sun Pascal prettyprinter

/tmp/∗ compiler temporary files

mon.out file produced for analysis by prof(1)

gmon.out file produced for analysis by gprof(1)

SEE ALSO

pindent(1)

Sun Pascal User’s Guide

Sun Pascal Reference Manual

Floating-Point Programmer’s Guide

DIAGNOSTICS

For a basic explanation do

tutorial% 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 which the recovery mechanism took 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:

EFatal error; no code will be generated. 

eNonfatal error. 

wWarning − a potential problem. 

sNonstandard Pascal construct warning. 

If a severe error occurs which inhibits further processing, the translator will give a diagnostic and then ‘QUIT’. 

Names whose definitions conflict with library definitions draw a warning.  The library definition will be replaced by the one supplied in the Pascal program. 

Sun Microsystems  —  Last change: 1 June 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026