/sys/doc/ Documentation archive



CC(I)                        5/15/74                        CC(I)



NAME
     cc - C compiler

SYNOPSIS
     cc [ -c ] [ -p ] [ -f ] [ -O ] [ -S ] [ -P ] file ...

DESCRIPTION
     Cc  is the UNIX C compiler.  It accepts three types of argu-
     ments:

     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'  sub-
     stituted  for `.c'.  The `.o' file is normally deleted, how-
     ever, if a single C program is compiled and  loaded  all  at
     one go.

     The  following  flags are interpreted by cc.  See ld(I) for
     load-time flags.

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

      -p   Arrange for the compiler to produce code which  counts
           the  number  of times each routine is called; also, if
           loading takes place, replace the standard startup rou-
           tine by one which automatically calls the monitor sub-
           routine(III) 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 gen-
           erated by use of prof(I).

      -f   In systems without hardware floating-point, use a ver-
           sion of the C compiler  which  handles  floating-point
           constants and loads the object program with the float-
           ing-point interpreter.  Do not use if the hardware  is
           present.

      -O   Invoke an object-code optimizer.

      -S   Compile the named C programs, and leave the assembler-
           language output on corresponding files suffixed  `.s'.

      -P   Run  only  the  macro preprocessor on the named C pro-
           grams, and leave the  output  on  corresponding  files
           suffixed `.i'.

     Other  arguments  are  taken  to be either loader flag argu-
     ments, 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.



                              - 1 -




CC(I)                        5/15/74                        CC(I)


FILES
     file.c          input file
     file.o          object file
     a.out           loaded output
     /tmp/ctm?       temporary
     /lib/c[01]      compiler
     /lib/fc[01]     floating-point compiler
     /lib/c2         optional optimizer
     /lib/crt0.o     runtime startoff
     /lib/mcrt0.o    runtime startoff of profiling
     /lib/fcrt0.o    runtime startoff for  floating-point  inter-
     pretation
     /lib/libc.a     C library; see section III.
     /lib/liba.a     Assembler  library  used by some routines in
     libc.a

SEE ALSO
     ``Programming in C-- a tutorial,'' C Reference Manual, moni-
     tor(III), prof(I), cdb(I), ld(I).

DIAGNOSTICS
     The  diagnostics  produced  by  C  itself are intended to be
     self-explanatory.  Occasional messages may  be  produced  by
     the  assembler or loader.  Of these, the most mystifying are
     from the assembler, in particular ``m,'' which means a  mul-
     tiply-defined external symbol (function or data).

BUGS






























                              - 2 -