xref: /original-bsd/old/pcc/cc/cc.1 (revision f71cd02e)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)cc.1 6.1 (Berkeley) 04/29/85

CC 1 ""
C 4
NAME
cc - C compiler
SYNOPSIS
cc [ option ] ... file ...
DESCRIPTION
Cc is the UNIX C compiler. 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 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 . See ld (1) for load-time options.

8 -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 dbx (1). Also pass the -lg flag to ld (1).

-go Have the compiler produce additional symbol table information for the obsolete debugger sdb (1). Also pass the -lg flag to ld (1).

-w Suppress warning diagnostics.

-p Arrange for the compiler to produce code which counts the number of times each routine is called. If loading takes place, 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).

-pg Causes the compiler to produce counting 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. Also, a profiling library is searched, in lieu of the standard C library. An execution profile can then be generated by use of gprof (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 `.s'.

-M Run only the macro preprocessor on the named C programs, requesting it to generate Makefile dependencies and send the result to the standard output.

-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 eliding comments.

-o " output" Name the final output file output . If this option is used the file `a.out' will be left undisturbed.

-D name=def

.ns

-D \*Sname Define the name to the preprocessor, as if by `#define'. If no definition is given, the name is defined as "1".

-U \*Sname Remove any initial definition of name .

-I \*Sdir `#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 directories on a standard list.

-L \*Sdir Library archives are sought first in directories named in -L options, then in directories on a standard list.

-f Use an alternate compiler which does not convert expressions involving only floats to double. This does not conform to the standard which states that all intermediate results should be converted to double but does provide a speed improvement for programs which don't require full double precision.

-B \*Sstring 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.c input file

file.o object file

a.out loaded output

/tmp/ctm? temporary

/lib/cpp preprocessor

/lib/ccom compiler

/lib/sccom compiler for single precision floats

/usr/c/occom backup compiler

/usr/c/ocpp backup preprocessor

/lib/c2 optional optimizer

/lib/crt0.o runtime startoff

/lib/mcrt0.o startoff for profiling

/usr/lib/gcrt0.o startoff for gprof-profiling

/lib/libc.a standard library, see intro (3)

/usr/lib/libc_p.a profiling library, see intro (3)

/usr/include standard directory for `#include' files

mon.out file produced for analysis by prof (1)

gmon.out file 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\(ema 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.
BUGS
The compiler currently ignores advice to put char, unsigned char, short or unsigned short variables in registers. It previously produced poor, and in some cases incorrect, code for such declarations.