CC(1)

NAME
cc - C compiler

SYNOPSIS
cc [ option ] ... file ...

DESCRIPTION
Cc is the DYNIX C compiler. The DYNIX compiler supports parallel programming (refer to the Guide to Parallel Programming). 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 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; they are assembled, producing `.o' files.

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

-c  Suppress the loading phase of the compilation; force an object file to be produced even if only one program is compiled.

-g  Have the compiler produce additional symbol table information for pdbx(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  Produce code that counts the number of times each routine is called. If loading takes place, replace the standard startup routine by one that 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 using prof(1).

-pg Produce counting code in the manner of -p, but invoke 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 using gprof(1).

-O  Invoke an object-code improver. Do not use on programs that contain asm statements, as the result may not be correct.

-Y  Causes all external or static variables not explicitly declared as shared or private to be shared. (Refer to the C Compiler User's Manual for information on the shared and private keywords.

-i  Suppress optimizations that are incorrect when memory locations might spontaneously change value. Memory-mapped registers have this property. This option has no effect if -O is not selected.

-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 with a `.s' suffix.

-SO Compile the named C programs and send the assembler-language output to 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 removing comments.

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

-v  List (on standard error) the utilities called by cc and their arguments. Information produced by the -v flag is useful for debugging.

-vn Like -v, but cc does not actually call the utilities.

-Dname=def

-Dname
    Define the 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. (The C preprocessor initially defines sequent, and unix as `1'. On Balance systems ns32000, and on Symmetry systems i386, are initially defined as `1').

-Idir
    Normally, `#include' files whose names do not begin with `/' are sought first in the directory of the file argument. If the -I option is given, dir is searched, not the directory within which file is located. If the `#include' files are not located after searching dir (when -I is specified) or the directory within which file is located (when -I is not specified), the directories in a standard list are then searched for the `#include' files.

-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[p02]
    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/o'.

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

-f1167 or -fpa
    -fpa is a synonym for -f1167 . This option directs the Symmetry C compiler to produce code for the Weitek 1167 floating-point accelerator. By default, the Symmetry C compiler produces code for the Intel 80387 floating-point processor. The Balance C compiler ignores this option. On Symmetry systems, files compiled with -f1167 may be linked with files compiled without -f1167, so long as 80387 functions don't return floating-point data to 1167 routines, and vice-versa. The -f1167 option is passed to the loader, which selects the Weitek versions of the C run-time libraries. The loader issues a warning if code compiled with -f1167 is linked with code compiled without -f1167.

Other arguments are taken to be loader option arguments, C-compatible object programs produced by an earlier cc run, or 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
file.s    assembly file
a.out    loaded output
/tmp/ctm?    temporary
/lib/cpp    preprocessor
/lib/ccom    compiler
/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/lib/libpps.a    Parallel Programming Library, see
intro(3)
/usr/include    standard directory for `#include' files
/usr/local/include    local 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—a tutorial
D. M. Ritchie, C Reference Manual
C Compiler User's Manual
Guide to Parallel Programming
monitor(3), prof(1), gprof(1), ddt(1), ld(1), pdbx(1), as(1)

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

NOTES
Unlike many other compilers, the DYNIX C compiler treats the words shared and private as keywords, and so these words cannot be used as identifiers. This occasionally causes confusion when code containing these identifiers is ported from other systems.

BUGS
The compiler ignores advice to put char, unsigned char, short, or unsigned short variables in registers.