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).
−20 Generates code for a 68020 CPU. To maintain compatibility with old code, the alignment rules are not changed unless you include the option -X134 on the command line. This alignment forces longwords to 32 bit boundaries, and cannot be used with programs which include stdio.h.
−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 Define the name to the preprocessor, as if by ‘#define’. If no definition is given, the name is defined as "1".
−E Does not compile the program. Instead, this option places the output of the preprocessor in the standard output file. This is useful for debugging preprocessor macros. The integrated preprocessor cannot generate output as fast as /lib/cpp, so use /lib/cpp for big jobs.
−f Generates code which assumes the presence of 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 "#include"s 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 /usr/include.
−o output Names the final output file output. If this option is used, the file a.out will be 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 may become slower as well.
−O2 Allows the optimizer to assume that memory locations do not change except by explicit stores. That is, it guarantees the optimizer 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 which can change them asynchronously with respect to the current process. Use this compile time option with extreme caution (or not at all) in device drivers, operating systems, shared memory environments, and when interrupts (or UNIX signals) are present.
−p Generates profiling code and links the code with routines which support prof(1). However, −p does not support profiling for programs compiled with the −f (floating point) option.
−pg Generates profiling code similar to −p, but links with a more comprehensive profiling mechanism which supports gprof(1). Like the −p option, −pg does not support profiling for programs compiled with the −f (floating point) option.
−R Makes initialized variables part of the text segment. Passed on to as.
−S Compiles the named C programs and leaves the assembler-language output on corresponding files suffixed ‘.s’.
−Uname Remove any initial definition of name.
−v Turns on verbose mode. Prints out the arguments to each phase of compilation and linking.
−w Suppresses warning messages.
−Xn Where n is an integer constant, turns on option number n. There are numerous options available for such things as signed bit fields, short return types, etc. You can find descriptions of these options in Section 8 of the UNIX Compiler Guide: C, Pascal, FORTRAN 77.
−Zn Turns off option number n. This is the reverse of the X option. This option is useful for turning off options that are on by default.
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/libmc.aUNIX standard I/O library for the 68020/68881
/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 trancendental floating point library
/usr/lib/libmm.a68020/68881 trancendental floating point math library
/usr/lib/libskyc.astandard I/O library compiled for sky FFP
/usr/lib/libskym.atranscendental math library for Sky FFP
/usr/lib/skycrt0.o∗startup code for the Sky FFP
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 intended to be self-explanatory and similar to those produced by the BSD compiler. Occasional messages may be produced by the assembler or loader.
4th Berkeley Distribution — 5 October 1987