Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cc(1) — Ultrix-11 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

ld(1)

monitor(3)

prof(1)

cc(1)

NAME

cc, pcc − C compiler

SYNTAX

cc [ option...] file... 
pcc [ option...] file... 

DESCRIPTION

The cc command is the UNIX C compiler.  It accepts several types of file arguments:

Those whose names end with .c are taken to be C source programs.  They are compiled, and each object program is left on the file whose name is that of the source with .o substituted for .c.  The .o file is normally deleted if a single C program is compiled and loaded at the same time. 

In the same way, those arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .o file. 

ENVIRONMENT

To use the SYSTEM V programming environment on your ULTRIX-11 system, you can either set the PROG_ENV environment variable to SYSTEM_FIVE or compile your programs using the −Y option (see below).  When you set the PROG_ENV variable, your programs are automatically compiled using the SYSTEM V compatibility libraries instead of the ULTRIX-11 libraries (default).  That is, this defines the preprocessor variable PROG_ENV and links in at load time the /lib/libcV.a library. 

If you are using the sh shell and want a SYSTEM V programming environment, use:

PROG_ENV=SYSTEM_FIVE
export PROG_ENV

If you are using the csh shell and want a SYSTEM V programming environment, use:

setenv PROG_ENV SYSTEM_FIVE

If you want a permanent SYSTEM V programming environment, make the appropriate settings in your shell startup file (.profile or .cshrc in your home directory).

OPTIONS

The following options are interpreted by cc.  For load-time options, see ld(1). 

−c Suppress the loading phase of the compilation, and force an object file to be produced even if only one program is compiled. 

−p Arrange for the compiler to produce code which counts the number of times each routine is called.  Also, if loading takes place, replace the standard startup routine by one which automatically calls monitor(3) at the start and arranges to write out a mon.out file at normal termination of execution of the object program.  An execution profile can then be generated by use of prof(1). 

−O Invoke the object-code optimizer. 

−S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed .s. 

−P Run only the macro preprocessor and place the result for each .c file in a corresponding .i file which has no # lines in it. 

−E Run only the macro preprocessor and send the result to the standard output.  The output is intended for compiler debugging and is unacceptable as input to cc. 

−V Create code suitable for use in overlaid programs (default option). 

−V7 Turn off the −V flag.  This is provided only for backwards compatibility with older versions of cc, and in general should not be used. 

−Y Compile the named C programs with the SYSTEM V compatibility library.  The /lib/libcV.a library is loaded prior to the /lib/libc.a library. 

−N Place switch tables into text space.  This is useful for 430 type programs, since the switch tables then go into the overlay with the module, saving valuable data space.  This option must not be used for separate instruction and data space programs! 

−o output
Name the final output file.  If this option is used the file a.out will be left undisturbed. 

−Dname=def

−Dname Define the name to the preprocessor, as if by #define.  If no definition is given, the name is defined as 1. 

−Uname Remove any initial definition of name. 

−Idir All #include files whose names do not begin with / are always sought first in the directory of the file argument, then in directories named in −I options, then in directories on a standard list. 

−Bstring Find substitute compiler passes in the files named string with the suffixes cpp, c0, c1 and c2.  If string is empty, use a standard backup version /usr/c/o. 

−t[p012]
Find only the designated compiler passes in the files whose names are constructed by a −B option.  In the absence of a −B option, the string is taken to be /usr/src/cmd/c/. 

Other arguments are taken to be either loader option arguments, or C-compatible object programs, typically produced by an earlier cc run, or perhaps libraries of C-compatible routines.  These programs, together with the results of any compilations specified, are loaded, in the order given, to produce an executable program with name a.out. 

The major purpose of pcc, the portable C compiler, is to serve as a model on which to base other compilers.  The pcc compiler does not support options −f , −E , −B , −Y , and −t .  It provides, among other things, initialized bit fields. 

RESTRICTIONS

The pcc portable C compiler is little tried on the PDP11.  The specialized code generated for that machine has not been well shaken down.  The −O optimizer was designed to work with cc.  Its use with pcc is suspect. 

DIAGNOSTICS

The diagnostics produced by C itself are intended to be self-explanatory.  Occasional messages may be produced by the assembler or loader.  Of these, the most mystifying are from the assembler, as(1), in particular m, which means a multiply-defined external symbol (function or data). 

FILES

file.cinput file
file.oobject file
a.outloaded output
/tmp/ctm?temporaries for cc
/lib/cpppreprocessor
/lib/c[01]compiler for cc
/usr/c/oc[012]backup compiler for cc
/usr/c/ocppbackup preprocessor
/lib/c2optional optimizer
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling
/lib/fcrt0.ostartoff for floating-point interpretation
/lib/libc.astandard library, see intro(3)
/lib/libcV.aSYSTEM V compatibility library
/usr/includestandard directory for #include files
/tmp/pc*temporaries for pcc
/usr/lib/ccomcompiler for pcc

SEE ALSO

adb(1), ld(1), monitor(3), prof(1)
The C Programming Language
C Reference Manual

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