Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cc(1) — SunOS 0.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

prof(1)

gprof(1)

adb(1)

ld(1)

dbx(1)

as(1)

CC(1)  —  User’s Manual — Commands

NAME

cc − C compiler

SYNOPSIS

cc [ −c ] [ −g ] [ −G ] [ −w ] [ −p ] [ −pg ] [ −O ] [ −R ] [ −S ] [ −E ] [ −C ] [ −o output ]

[ −Dname=def ] [ −Dname ] [ −Uname ] [ −Idir ] [ −Bstring ] [ −t[p012]] file ...

DESCRIPTION

Cc is the UNIX C compiler which translates programs written in the C programming language into executable load modules, or relocatable binary programs for subsequent loading with the ld(1) linker. Cc accepts 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 deleted if a single C program is compiled and loaded all at once. 

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

OPTIONS

The following options are interpreted by cc. See ld(1) for load-time options.

−c Compile only: suppress the load phase of the compilation, and force an object file to be produced even if only one program is compiled. 

−g Produce additional symbol table information for adb(1). Also pass the −lg flag to ld(1).

−G Produce additional symbol table information for dbx(1). Also pass the −lg flag to ld(1). Note that dbx is not currently supported. 

−w Suppress warning messages. 

−p Produce profiling code to count the number of times each routine is called.  If loading takes place, replace the standard startup routine by one that automatically calls monitor(3) and use a special profiling library in lieu of the standard C library. When the program is run, the file mon.out is created and an execution profile can be generated with prof(1). An execution profile can then be generated by use of prof(1).

−pg Produce profiling code in the manner of −p, but invokes a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file at normal termination.  gprof(1) generates an execution profile.

−O Optimize the generated object-code. 

−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 ‘.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 removing comments. 

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

−Dname=def

−Dname Define 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 ‘#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 the /usr/include directory. 

−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 whose names are constructed by a −B option.  In the absence of a −B option, the string is taken to be /usr/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. 

FILES

file.cinput file
file.oobject file
a.outloaded output
/tmp/ctm?temporary
/lib/cpppreprocessor
/lib/ccomcompiler
/usr/c/occombackup compiler
/usr/c/ocppbackup preprocessor
/lib/c2optional optimizer
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling
/lib/gcrt0.ostartoff for gprof-profiling
/lib/libc.astandard library, see intro(3)
/lib/libc_p.aprofiling library, see intro(3)
/usr/includestandard directory for ‘#include’ files
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)

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), gprof(1), adb(1), ld(1), dbx(1), as(1)

DIAGNOSTICS

The diagnostics produced by C itself are intended to be self-explanatory.  Occasional messages may be produced by the assembler or loader. 

Sun System Release 0.3  —  25 April 1983

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