Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cc(1) — Duplix 5.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

prof(1)

gprof(1)

adb(1)

dbx(1)

ld(1)

f77(1)

pc(1)

CC(1)  —  Unix Programmer’s Manual

NAME

cc − C compiler

SYNOPSIS

cc [ options ] files

DESCRIPTION

cc is an optimizing C compiler.  It accepts several types of arguments. 

Arguments whose names end with “.c” are C source programs.  They are compiled and left in a “.o” file in the working directory. 

Arguments whose names end with “.s” are assembly language source programs.  They are assembled and left in a “.o” file in the working directory. 

The “.o” file is deleted if a single source file is compiled and linked. 

cc creates “.s” files for each module only when the user compiles with the −S option. 

OPTIONS

cc accepts the options listed below.  Additional options are supported by ld(1). 

−ansi Provides basic compiler support for ANSI C but does not achieve full conformance due to rounding incompatibilities when allocating floating point variables to machine registers. 

−ansiconform
Provides preliminary conformance to the proposed ANSI C draft. However, this option supports fewer floating point optimizations than does the −ansi flag. 

−c Compiles to the “.o” level only.  Does not link. 

−C Does not strip comments from the preprocessor output.  Must be used with the −E option. 

−Dname=def

−Dname Defines the name to the preprocessor, as if by “define”.  If no definition is given, the name is defined as “1”. 

−E Places the output of the preprocessor in the standard output file.  Does not compile the program.  This is useful for debugging preprocessor macros.  Use /lib/cpp for big jobs because the integrated preprocessor cannot generate output as fast as /f2/lib/cpp/f1. 

−f Generates code for a 68881 coprocessor.  By default many of the functions supported by the 68881 will be inline as well; use -Z129 if you want a transcendental call to go to the routine instead.  The −f option does not support profiling. 

−g Generates BSD style debugger information in the assembly file for use with a debugger such as dbx(2). 

−ga Generates a stack frame for every routine, regardless of need. 

−k Prevents the compiler from optimizing an “and” with a single bit into a BTST instruction.  Some I/O devices require word access to their registers while BTST is a byte access instruction. 

−Idir Looks for “#include” files whose names do not begin with “/” first in the directory of the file argument, then in directories named in −I options, then in /f2/usr/include/f1. 

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

−O Performs various speed optimizations, such as moving constant expressions out of loops. Generally this makes your programs somewhat larger.  If their performance is not loop bound, they can become slower as well. 

−O2 This flag is an older version of the −OM flag. It allows backwards compatibility. 

−OL Optimizes the program to be as fast as possible even if it makes the program larger. In particular, most of the available resources are allocated to optimizations of the innermost loops.  It is  counter-productive to specify −OL on code that contains no loops or that is rarely executed as it makes the whole program larger but not necessarily faster. 

−OM Specifies that memory locations do not change except by explicit stores. The optimizer is guaranteed that no memory locations are I/O device registers that can be changed by external hardware and no memory locations are being shared with other processes that can change them asynchronously with respect to the correct process. 

−OLM This option is equivalent to -OL and -OM. 

−OML This option is equivalent to -OL and -OM. 

−p Generates profiling code and links the code with routines that support prof(1).  However, −p does not support profiling for programs compiled with the −f (floating point) option.  (Not implemented.) 

−pg Generates profiling code similar to −p but links with a more comprehensive profiling mechanism that supports gprof(1).  Like the −p option, −pg does not support profiling for programs compiled with the −f (floating point) option.  (Not implemented.) 

−R Makes initialized variables part of the text segment and passes them on to as. 

−S Compiles the named C programs and leaves the assembler-language output on corresponding files suffixed “.s”. 

−Uname Removes any initial definition of name.

−v Turns on verbose mode so cc prints out the arguments to each phase of compilation and linking. 

−w Suppresses warning messages. 

−Xn Turns on option n (an integer constant). Numerous options are available for such things as signed bit fields, short return types, etc.  Section 8 of the UNIX Compiler Guide:  C, Pascal, FORTRAN 77 describes these options. 

−Zn Turns off option number n that is on by default or was turned on with the X option. 

FILES

file.[cs]input file
file.oobject file
a.outloaded output
/bin/asassembler
/lib/cppC preprocessor
/lib/crt0.ostartup code
/usr/lib/ccomC compiler
/usr/includestandard directory for “#include” header files
/usr/lib/libc.aUNIX standard I/O library
/usr/lib/libc_p.aprofiling UNIX standard I/O library
/usr/lib/gcrt0.o∗profiling startup code for gprof(1)
/lib/mcrt0.o∗profiling startup code for prof(1)
/usr/lib/libm.a transcendental floating point math library
/usr/lib/libm_p.aprofiling transcendental floating point library

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
UNIX Compiler Guide:  C, Pascal, FORTRAN 77
as(1)
, prof(1), gprof(1), adb(1), dbx(1), ld(1), f77(1), pc(1)

DIAGNOSTICS

The diagnostics produced by the C compiler are self-explanatory and similar to those produced by the BSD compiler.  Occasional messages can be produced by the assembler or loader. 
 
 
 

4th Berkeley Distribution  —  March 6, 1989

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