PC(1) HP-UX 2.1 PC(1) NAME pc - Pascal compiler SYNOPSIS pc [ options ] files HP-UX COMPATIBILITY Level: HP-UX/STANDARD Origin: HP Native Language Support: 8-bit and 16-bit characters in strings and comments. Remarks: This manual page describes the generic HP Pascal compiler; implementation dependencies for different machines are noted as needed. Currently the Series 200/300 and Series 500 computers support HP Pascal under HP-UX, as described in this document. 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. 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 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 the Pascal Symbolic Debugger (pdb), and ensure that the program is linked as required by pdb. See the appropriate implementation reference manual for more information on symbolic debugging support. -L Write a program listing to stdout (or for the Series 300 only, to the file given in the $LIST filename$ option in the source). -lx Cause the linker to search the library named either /lib/libx.a (tried first) or /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 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 a set of identifiers indicating the subprocess(es). This option works in two modes: 1) if c is a single identifier, name represents the full path name 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 take on 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, -W d,-U (Series 500) 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 Enable 16-bit Native Language Support when parsing string literals and comments (same as $HP16 ON$). Note that 8-bit parsing is always supported. The implementation-specific options on the Series 200/300 are: +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 may be linked independently. Use of this option is discouraged for portability reasons. It is provided to facilitate migration from previous releases of the Series 300 (where .a files were always generated), to this and subsequent releases. Otherwise, it is recommended that modules which need separate linkability be placed in separate source files. The implementation-specific options on the Series 500 are: +E Cause the program to be linked with the library /lib/libpcesc.a which transforms all execution errors (HP-UX signals, Pascal run-time errors, Pascal I/O errors and HP-UX errors) into escapes. This differs from the default library /lib/libpccat.a which prints the appropriate error message and aborts the program. +F Cause the compiler to generate information which is used by various program analyzers. +H [bytes] Display (if bytes is omitted) or set a Pascal program's maximum heap size. Bytes is the maximum number of bytes in the heap. +Q dfile Cause dfile to be read before compilation of each source file. Dfile may only contain compiler options. +U Cause the compiler to upshift externally visible names, default is lower case (same as $UPSHIFT_LEVEL1 ON$). +W [bytes] Display (if bytes is omitted) or set a Pascal program's working set size. Bytes is the number of bytes in the program's working set; FILES file.p input file (Pascal source file) file.a any archive file to be searched at link time (or for the series 300 only, optionally generated object archive file) file.o object file to be relocated at link time (or generated object file for the Series 500 only) a.out linked executable output file /bin/pc compiler and linker driver program /usr/lib/pascomp compiler /usr/lib/paserrs compiler error message file /usr/lib/escerrs Pascal escape codes (Series 300 only) /usr/lib/syserrs HP-UX system messages (Series 300 only) /usr/lib/ioerrs Pascal I/O results (Series 300 only) /lib/crt0.o runtime startup (Series 300 only) /lib/prt0.o runtime startup (Series 500 only) /lib/libpc.a Pascal run-time library /lib/libm.a HP-UX math library (Series 300 only) /lib/libpccat.a Pascal run-time library, reports errors and aborts program (Series 500 only) /lib/libpcesc.a Pascal run-time library, translates errors into escapes (Series 500 only) /usr/tmp/* temporary files used by the compiler; names are created by tmpnam(3S). SEE ALSO HP Pascal Language Reference, HP Part No. 98680-90015 (Series 200/300). Pascal/9000 Language Reference Manual, HP Part No. 97082- 90001 (Series 500). Programming in Pascal with Hewlett-Packard Pascal, by Peter Grogono (Series 300/500). 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 recieve error messages, unless that would result in duplication of error messages printed on the terminal. HARDWARE DEPENDENCIES Series 200/300: The archived object (.a) files are no longer generated directly by the compiler. To facilitate use of previously existing makefiles and scripts which depended on the archive generation, the PCOPTS environment variable can be used (e.g. set PCOPTS="+a $PCOPTS"). Series 500: The following options are no longer supported: -b, -e, and -f. The following options must now be specified with the -W d,... option or the + shorthand: -E, -F, -H [bytes], and -W [bytes]. To use the +H or +W options on an executable file other than a.out, the file to be examined (modified) must be specified with the -o option. To set the heap of program foo to 1000000 use: pc +H 1000000 -o foo do not use: pc +H 1000000 -W l,-o,foo