PC(1)
NAME
pc − Pascal compiler
SYNOPSIS
pc [ options ] file ...
REMARKS
This manual page describes the generic HP Pascal compiler; implementation dependencies for different machines are noted as needed.
DESCRIPTION
Pc is the HP standard Pascal compiler. It accepts several types of file arguments:
(1) Arguments whose names end with .p are taken to be Pascal source files. They are each compiled, and each corresponding object program or module(s) is left in the current directory in a file whose name is that of the source, with .o substituted for .p. The .o file will be immediately deleted (leaving only the linked executable file) if only a single source is compiled and linked, if the −C option is specified, or if the source fails to compile correctly.
(2) All other file arguments, including those whose names end with .o or .a, are passed on to the linker (ld(1)) to be linked into the final program.
Options and other arguments can be passed to the compiler through the PCOPTS environment variable as well as on the command line. The compiler picks up the value of PCOPTS and places its contents before any arguments on the command line. For example (in sh(1) notation),
$ PCOPTS=-v
$ export PCOPTS
$ pc -L prog.p
is equivalent to
$ pc -v -L prog.p
When set, the TMPDIR environment variable specifies a directory to be used for temporary files, overriding the default directories /tmp and /usr/tmp.
Options
The following options are recognized:
−A Produce warnings for the use of non-ANSI-Pascal features. (Same as $ANSI ON$).
−C Suppress code generation. No .o files will be created and linking will be suppressed. This is effectively a request for syntax/semantic checking only (same as $CODE OFF$).
−c Suppress linking and only produce object (.o) files from source files.
−g Generate additional information needed by a symbolic debugger, and ensure that the program is linked as required. See the appropriate implementation reference manual for more information on symbolic debugging support.
−G Prepare object files for profiling with gprof (see gprof(1)).
−Idir Add dir to the list of directories that are searched for $INCLUDE files whose names do not begin with /. The directory containing the source file is always searched first, followed by any directories specified with the −I option, then the current working directory, and finally the standard directory /usr/include.
−L Write a program listing to stdout (see the DEPENDENCIES section below for exceptions).
−lx Cause the linker to search first in the library named /lib/libx.a and then in /usr/lib/libx.a (see ld(1)).
−N Cause the output file from the linker to be marked as unshareable (see −n). For details and system defaults, refer to the linker documentation (ld(1)).
−n Cause the output file from the linker to be marked as shareable (see −N). For details and system defaults, refer to the linker documentation (ld(1)).
−o outfile Name the output file from the linker outfile instead of a.out.
−p Prepare object files for profiling with prof (see prof(1)).
−P lines Specifies the number of lines (including any header or trailer) which should be listed per page of generated listing (same as $LINES n$).
−Q Cause the output file from the linker to be marked as not demand loadable (see −q). For details and system defaults, refer to the linker documentation (ld(1)).
−q Cause the output file from the linker to be marked as demand loadable (see −Q). For details and system defaults, refer to the linker documentation (ld(1)).
−s Cause the output of the linker to be stripped of symbol table information (see ld(1) and strip(1)). (This option is incompatible with symbolic debugging.)
−t c,name Substitute or insert subprocess c with name where c is one or more of an implementation-defined set of identifiers indicating the subprocess(es). This option works in two modes: 1) if c is a single identifier, name represents the full pathname of the new subprocess; 2) if c is a set of (more than one) identifiers, name represents a prefix to which the standard suffixes are concatenated to construct the full path name of the new subprocesses. The values c can assume are:
c compiler body (standard suffix is pascomp)
0 same as c
l linker (standard suffix is ld)
−v Enable verbose mode, producing a step-by-step description of the compilation process on stderr.
−w Suppress warning messages (same as $WARN OFF$).
−W c,arg1[,arg2,...,argN]
Cause arg1 through argN to be handed off to subprocess c. The argi are of the form −argoption[,argvalue], where argoption is the name of an option recognized by the subprocess and argvalue is a separate argument to argoption where necessary. The values that c can assume are those listed under the −t option, as well as the value d (driver program), which has a special meaning explained below.
For example, the specification to pass the -r (preserve relocation information) option to the linker would be:
-W l,-r
The −W d option specification allows additional, implementation-specific options to be recognized and passed through the compiler driver to the appropriate compiler subprocesses. For example, on Series 300:
-W d,-U
will send the option −U to the driver and compiler. Furthermore, a shorthand notation for this mechanism can be used by prepending + to the option name; as in
+U
which is equivalent to the previous option expression. Note that for simplicity this shorthand is applied to each implementation-specific option individually, and that the argvalue is no longer separated from the argoption by a comma (see −W).
−y Generate additional information needed by static analysis tools, and ensure that the program is linked as required for static analysis. This option is incompatible with optimization.
−Y Enable 16-bit Native Language Support when parsing string literals and comments (same as $NLS_SOURCE ON$). Note that 8-bit parsing is always supported.
+a Cause the compiler to generate archived object (.a) files instead of simple object (.o) files. This allows source files containing multiple HP Pascal modules to be compiled such that each module can be linked independently. Use of this option is discouraged for portability reasons. It is provided to facilitate migration from Series 200 HP-UX releases prior to Release 5.1 (where .a files were always generated), to 5.1 and subsequent releases. Otherwise, it is recommended that modules needing separate linkability be placed in separate source files. To facilitate use of previously existing makefiles and scripts that depended on the archive generation, the PCOPTS environment variable can be used (e.g., set PCOPTS="+a $PCOPTS").
+Q dfile Cause dfile to be read before compilation of each source file. Dfile may contain only compiler directives.
+R Inhibit range checking (Same as $RANGE OFF$).
DIAGNOSTICS
The diagnostics produced by pc are intended to be self-explanatory. Occasional messages may be produced by the linker.
A list of all compiler errors may be found in /usr/lib/paserrs.
If a listing is requested (−L option), errors are written to the listing file (stdout). If a listing is requested and either or both of stdout/stderr has been redirected to something other than a terminal, errors will also be written to stderr. If no listing is requested (no −L option), errors are written to stderr. This effectively guarantees that stderr will always receive error messages, unless that would result in duplication of error messages printed on the terminal.
DEPENDENCIES
Series 300
The −I and −y options are not supported on the Series 300.
The −L option writes a program listing to the file given in the $LIST filename$ option in the source, instead of to stdout.
The following options are implemented only on the Series 300:
+A Cause the compiler to always use 2-byte data and stack alignment rules instead of default 4-byte alignment rules for stacks and data objects exceeding four bytes. Refer to the reference manual for more details.
+M Cause the compiler not to generate inline code for the MC68881 floating-point coprocessor. Library routines will be referenced for math and intrinsic operations.
+bfpa Generate code that uses the HP98248A floating point accelerator card, if it is installed at run-time. If the card is not installed, floating point operations are done on the MC68881 math coprocessor.
+ffpa Generate code for the HP98248A floating point accelerator card. This code does not run unless the card is installed.
+U Allow certain packed fields and elements to be passed by VAR (Same as $ALLOW_PACKED ON$).
Series 800
The following options are implemented on the Series 800:
−O Turn on optimization. The compiler performs full code optimization.
−S Output an assembly file. This file is named filename.s, where filename is the basename of the source file.
+C Convert MPE-style file names (file[.group[.account]]) into HPUX-style filenames ([[account/]group/]file) in compiler directives like $INCLUDE and $SYSINTR. This option expects a strictly MPE-like directory structure - i.e. "group"-level directories under "account"-level directories, and source files only in "group"-level directories. See the HP Pascal Programmers’ Guide for the Series 800 for fuller details on the semantics of this option. Same as $CONVERT_MPE_NAMES ON$.
+N Turn off notes (same as $NOTES OFF$). Notes are also automatically turned off when −w is specified.
+Oopt Invoke optimizations selected by opt. If opt is ‘1’, then only level 1 optimizations are handled. If opt is ‘2’, then all optimizations are performed. The option +O2 is the same as −O.
The following Series 300 options are ignored with warnings: +M, +bfpa, +ffpa.
FILES
file.p input file (Pascal source file)
file.o compiler-generated or other object file that is to be relocated at link time
a.out linked executable output file
/usr/lib/pascomp compiler
/usr/lib/paserrs compiler error message file
/lib/libc.a HP-UX system library (C-language library)
/usr/tmp/∗ temporary files used by the compiler
Series 300
file.a optionally generated object archive file
/usr/lib/escerrs Pascal escape codes
/usr/lib/syserrs HP-UX system messages
/usr/lib/ioerrs Pascal I/O results
/lib/crt0.o runtime startup
/lib/libpc.a Pascal run-time library
/lib/libp/libpc.a profilable Pascal run-time library
/lib/libm.a HP−UX math library
/usr/lib/libheap2.a Pascal run-time library, alternate heap manager
/lib/libp/libheap2.a profilable Pascal run-time library, alternate heap manager
Series 800
/usr/lib/nls/$LANG/pc_msgs.cat
error message catalog
/usr/include/pasesc.ph
symbolic definitions of library escape codes
/lib/crt0.o runtime startup
/usr/lib/libcl.a Pascal run-time library
SEE ALSO
Programming in Pascal with Hewlett-Packard Pascal, by Peter Grogono.
Series 300
HP Pascal Reference Manual.
Series 800
HP Pascal Reference Manual.
HP Pascal Programmers’ Guide.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
International Code Set Support
Single- and multi-byte character code sets are supported only in strings and comments.
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989