CC(1) — UNIX Programmer’s Manual
NAME
cc − C compiler
SYNOPSIS
cc [ option ] ... file ...
DESCRIPTION
Cc is the UNIX C compiler. Cc has been recently modified to accept arbitrary length identifiers and produce a new object file format, (see old(8) for information on operating with old format programs).
Cc accepts several types of arguments as follows:
Arguments with names that end with ‘.c’ are assumed to be C source programs and are compiled. Each object program is than left on the file with the name 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.
Similarly, arguments with names that end with ‘.s’ are assumed to be assembly source programs and are assembled, thereby producing a ‘.o’ file.
The following options are interpreted by cc: (See ld(1) for load-time options.)
−c Suppress the loading phase of the compilation, and force an object file to be produced, even if only one program is compiled.
−g Have the compiler produce additional symbol table information for sdb(1). Also pass the −lg flag to ld(1).
−w Suppress warning diagnostics.
−p Command the compiler to produce code which counts the number of times each routine is called. If loading occurs, 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 an object-code improver.
−R Passed on to as, making initialized variables shared and read-only.
−S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed with ‘.s’.
−E Run only the macro preprocessor on the named C programs, and send the result to the standard output.
−C prevent the macro preprocessor from omitting comments.
−o output
Name the final output file output. If this option is used, the file ‘a.out’ is not disturbed.
−Dname=def
−Dname Define the name to the preprocessor, as if using ‘#define’. If no definition is given, the name is defined as "1".
−Uname Remove any initial definition of name.
−Idir ‘#include’ files with names that do not begin with ‘/’ are always sought first in the directory of the file argument, then in directories named in −I options, and finally in directories on a standard list.
−Bstring Find substitute compiler passes in the files named string, with the suffixes cpp, ccom and c2. If string is empty, use a standard backup version.
−t[p012] Find only the designated compiler passes in the files with names constructed by a −B option. In the absence of a −B option, the string is assumed to be ‘/usr/c/’.
−d Apply dl (downloader) to yield filename.dl
−r Apply rev(1) to yield filename.r
−z Trace exec() calls.
−s Skip assembly, result is filename.s
−L Output to a file with a filename that is identical to the input file and whose filetype is ’.L’.
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.
FILES
a.outloaded output
b.out
/tmp/ctm%05.5d temporary
/bin/as Patrick’s 68k assembler
/lib/cpppreprocessor
/bin/ccomcompiler
/bin/c2 optional optimizer
/lib/crt0runtime startoff
/bin/dl MACSBUG down loader
/includestandard directory for ‘#include’ files
/bin/ld 68k link editor
/lib/mcrt0startoff for profiling
/bin/rev Pratt’s .o reformatter
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
monitor(3), prof(1), adb(1), ld(1), sdb(1), old(8)
NOTES
/lib/cpp now handles 60 PREDEFINES, and 32 character long #define names.
DIAGNOSTICS
The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or loader.
BUGS
The compiler currently ignores advice to put char, unsigned char, short or unsigned short variables in registers. It previously produced inadequate, and in some cases incorrect, code for such declarations.
4th Berkeley Distribution — @(#)cc.1 1.1 %Q% %Y%