CC(1) — UNIX 3.0
NAME
cc, pcc − C compiler
SYNOPSIS
cc [ option ] ... file ...
pcc [ option ] ... file ...
DESCRIPTION
Cc is the UNIX C compiler. Pcc is the portable version for a PDP-11 machine. They accept several types of arguments:
Arguments 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, however, if a single C program is compiled and loaded all at one go.
In the same way, arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .o file.
The following options are interpreted by cc and pcc. See ld(1) for link editor options.
−c Suppress the link edit 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 link editing takes place, replace the standard startoff routine by one which automatically calls monitor(3C) 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).
−f Link the object program with the floating-point interpreter for systems without hardware floating-point.
−g Cause the compiler to generate additional information needed for the use of sdb(1). (VAX-11/780 only.)
−dn This option is passed through to as(1). (VAX only.)
−O Invoke an object-code optimizer.
−S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed .s.
−E Run only the macro preprocessor on the named C programs, and send the result to the standard output.
−P Run only the macro preprocessor on the named C programs, and leave the result on corresponding files suffixed .i.
−C Comments are not stripped by the macro preprocessor.
−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 Change the algorithm for searching for #include files whose names do not begin with / to look in dir before looking in the directories on the standard list. Thus, #include files whose names are enclosed in "" will be searched for first in the directory of the file argument, then in directories named in −I options, and last in directories on a standard list. For #include files whose names are enclosed in <>, the directory of the file argument is not searched.
−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.
−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 /lib/n.
Other arguments are taken to be either link editor option arguments, or C-compatible object programs, typically produced by an earlier cc or pcc run, or perhaps libraries of C-compatible routines. These programs, together with the results of any compilations specified, are linked (in the order given) to produce an executable program with the name a.out.
FILES
file.c input file
file.o object file
a.out linked output
/tmp/ctm∗ temporary
/lib/cpp preprocessor
/lib/c[01] PDP-11 compiler, cc
/usr/lib/comp
compiler, pcc
/lib/ccom VAX compiler, cc
/lib/c2 optional optimizer
/lib/oc∗ backup compiler, occ
/lib/nc∗ test compiler, ncc
/lib/fc1 PDP-11 floating-point compiler, cc
/lib/crt0.o runtime startoff
/lib/mcrt0.o startoff for profiling
/lib/fcrt0.o startoff for floating-point interpretation
/lib/libc.a standard library, see (3)
/usr/include standard directory for #include files
SEE ALSO
B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall, 1978.
B. W. Kernighan, Programming in C−A Tutorial.
D. M. Ritchie, C Reference Manual.
adb(1), as(1), ld(1), prof(1), monitor(3C).
DIAGNOSTICS
The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or the link editor. Of these, the most mystifying are from the PDP-11 assembler, in particular m, which means a multiply-defined external symbol (function or data).
May 16, 1980