

cc                           Command                           cc




Compiler controller

cccc [_c_o_m_p_i_l_e_r _o_p_t_i_o_n_s] _f_i_l_e .... [_l_i_n_k_e_r _o_p_t_i_o_n_s]

cc is  the program that  controls compilation of  C programs.  It
guides files of source and object code through each phase of com-
pilation and linking.  cccc has  many options to assist in the com-
pilation of  C programs; in essence, however, all  you need to do
to  produce an  executable file  from your C  program is  type cccc
followed by the name of the file or files that hold your program.
It  checks whether  the file  names you  give it  are reasonable,
selects the  right phase for each file,  and performs other tasks
that ease the compilation of your programs.

***** File Names *****

cc  assumes that each  file name  that ends  in .c or  .h is  a C
program and passes it to the C compiler for compilation.

cc assumes  that each file  argument that ends  in .s is  in Mark
Williams assembly  language and  processes it with  the assembler
as.

cc also passes all files with  the suffixes .o or .a unchanged to
the linker ld.

***** How cc Works *****

cc normally works as follows: First, it compiles or assembles the
source files, naming  the resulting object files by replacing the
.cc or .ss suffixes with the  suffix .oo.  Then, it links the object
files  with the  C  runtime startup  routine and  the standard  C
library, and leaves the result  in file _f_i_l_e.  If only one object
file is created  during compilation, it is deleted after linking;
however, if more than one object file is created, or if an object
file of  the same name existed before you  began to compile, then
the object file or files are not deleted.

***** Options *****

The following lists  all of cccc's command-line options.  cc passes
some options  through to the  linker ld unchanged,  and correctly
interprets to it the options -oo and -uu.

A number  of the options  are esoteric and normally  are not used
when compiling a C  program.  The following are the most commonly
used options:


         -cc      Compile only; do not link
         -ff      Include floating-point pprriinnttff
         -ll_n_a_m_e  Pass library lliibb_n_a_m_e.aa to linker
         -oo _n_a_m_e Call output file _n_a_m_e
         -VV      Print verbose listing of cccc's action


COHERENT Lexicon                                           Page 1




cc                           Command                           cc





-AA  MicroEMACS option.  If an error occurs during compilation, cc
    automatically invokes the  MicroEMACS screen editor.  The er-
    ror or errors are displayed in one window and the source code
    file in the other, with the cursor set to the line number in-
    dicated by  the first error message.   Typing <ctrl-X>> moves
    to the next error, <ctrl-X>< moves to the previous error.  To
    recompile, close the  edited file with <ctrl-Z>.  Compilation
    will continue  either until the program  compiles without er-
    ror, or  until you  exit from  the editor by  typing <ctrl-U>
    followed by <ctrl-X><ctrl-C>.

-BB[_s_t_r_i_n_g]
    Backup option.   Use alternate  versions of the  compiler for
    cc0, cc1,  cc2, and cc3.  If string  is supplied, cc prepends
    it to  the names of  the phases of  the compiler to  form the
    pathnames where these  are found.  Otherwise, cc prepends the
    name of the current directory.  If a -t option was previously
    given, only the parts of the compiler specified by it are af-
    fected.  Any  number of -B  and -t options may  be used, with
    each -t  option specifying the passes  affected by the subse-
    quent -B option.  For example, the command

        cc -tp2 -Bnew hello.c

    compiles hheelllloo.cc using nneewwcccc22 in place of the ordinarily used
    /lliibb/cccc22, and  using nneewwccpppp in  place of the  ordinarily used
    /lliibb/ccpppp.

-cc  Compile option.  Suppress  linking and the removal of the ob-
    ject files.

-DD_n_a_m_e[=_v_a_l_u_e]
    Define  name to  the  preprocessor, as  if set  by a  #define
    directive.  If value is present, it is used to initialize the
    definition.

-EE  Expand option.  Run the C preprocessor ccpppp and write its out-
    put onto the standard output.

-ff  Floating point option.  Include library routines that perform
    floating-point   arithmetic.    Because  the   floating-point
    routines require approximately  five kilobytes of memory, the
    standard C library does not include them; the -ff option tells
    the  compiler to  include  them.  If  a  program is  compiled
    without the -ff option  but attempts to print a floating point
    number  during  execution by  using  the e,  f,  or g  format
    specifications to printf, the message

        You must compile with -f option for floating point

    will be printed and the program will exit.




COHERENT Lexicon                                           Page 2




cc                           Command                           cc



-II _n_a_m_e
    IInclude option.  Specify  a directory the preprocessor should
    search  for files  given  in #include  directives, using  the
    following criteria: If the #iinncclluuddee statement reads

        #include "file.h"

    cccc searches for ffiillee.hh first in the source directory, then in
    the directory named in  the -II_n_a_m_e option, and finally in the
    system's  default  directories.   If the  #iinncclluuddee  statement
    reads

        #include <file.h>

    cccc searches for ffiillee.hh  first in the directories named in the
    -II_n_a_m_e option, and  then in the system's default directories.
    Multiple -II_n_a_m_e options are executed in the order of their of
    appearance.

-KK  Keep  option.  Do not erase  the intermediate files generated
    during compilation.  Temporary files will be written into the
    current directory.

-ll _n_a_m_e
    llibrary option.   Pass the name  of a library  to the linker.
    cc  expands -lname  into /lliibb/lliibb_n_a_m_e.aa.   If  an alternative
    library prefix has been specified by the -tl and -Bstring op-
    tions,  then -lname  expands to  stringlliibbname.aa.   Note that
    this is a linker option, and so must appear at the end of the
    cc command line, or it will not be processed correctly.

-MM _s_t_r_i_n_g
    Machine option.  Use  an alternate version of cc0, cc1, cc1a,
    cc1b,  cc2, cc3,  as, lib*.a,  and  crts0.o, named  by fixing
    string  between the  directory  name and  the  pass and  file
    names.

-nn   Instruct the  linker  ld to  bind the  output with  separate
    shared  and private  segments, and which  each starting  on a
    separate  hardware-segment  boundary.   This  allows  several
    processes to  simultaneously use one copy  of the shared seg-
    ment.  Note that programs  linked with this option will run a
    little more slowly than  if they were not so linked; however,
    if a  program forks  (e.g., kkeerrmmiitt) or  will be used  by more
    than  one user  at a time  (e.g., MicroEMACS),  this slightly
    slower time  will be more than offset  by the program's being
    spared having to read an entire copy of itself from the disk.

-NN[pp00112233ssddllrrtt]_s_t_r_i_n_g
    Name option.  Rename a specified pass to string.  The letters
    p0123sdlrt refer,  respectively, to cpp, cc0,  cc1, cc2, cc3,
    the assembler, the linker, the libraries, the run-time start-
    up, and the temporary files.




COHERENT Lexicon                                           Page 3




cc                           Command                           cc



-oo _n_a_m_e
    Output option.   Rename the executable file  from the default
    to _n_a_m_e.  If this option  is not used, the executable will be
    named after the first .cc or .oo file on the command line.

-OO  Optimize  option.  Run the  code generated by  the C compiler
    through the  peephole optimizer.  The optimizer  pass is man-
    datory for  the i8086, Z8000, and  M68000 compilers, and need
    not be requested.  It is optional for the PDP11 compiler, but
    is recommended  for all files  except those that  consist en-
    tirely of initialized tables of data.

-qq[pp00112233ss]
    Quit  option.    Terminate  compilation  after   running  the
    specified pass.   The letters pp00112233ss  refer, respectively, to
    cpp, cc0, cc1, cc2,  cc3, and the assembler.  For example, to
    terminate compilation after running the parser cc0, type -qq00.

-QQ  Quiet option.  Suppress all messages.

-SS  Suppress  the object-writing and link  phases, and invoke the
    disassembler cc3.  This  option produces an assembly-language
    version of a C program for examination, for example if a com-
    piler  problem is  suspected.   The assembly-language  output
    file name replaces the .c suffix with .s.  This is equivalent
    to the -VVAASSMM option.

-tt[pp0011aabb2233ssddllrrtt]
    Take option.   Use alternate versions of  the compiler phases
    and  other files  specified in the  following string.   If no
    following string  is given, the cccc  uses alternate version of
    every phase of the compiler, except the preprocessor.  If the
    -tt option is followed by  a -BB option, cccc prepends the prefix
    string named  in the -BB option to the  phases and files named
    in the  -tt option; otherwise, the it  looks for the alternate
    forms in the current directory.

-UU _n_a_m_e
    Undefine symbol  name.  Use  this option to  undefine symbols
    that the preprocessor defines implicitly, such as the name of
    the native system or machine.

-VV  Verbose  option.  cccc prints onto the  standard output a step-
    by-step description of each action it takes.

VV_s_t_r_i_n_g
    Variant option.   Toggle (i.e., turn  on or off)  the variant
    _s_t_r_i_n_g during  the compilation.  Variants that  are marked oonn
    are turned  on by  default.  Options marked  SSttrriicctt: generate
    messages that warn  of the conditions in question.  cc recog-
    nizes the following variants:

-VVAASSMM
   Output assembly-language code.  Identical to -SS option, above.
   It can  be used with  the -VVLLIINNEESS option,  described below, to


COHERENT Lexicon                                           Page 4




cc                           Command                           cc



   generate a  line-numbered file of  assembly language.  Default
   is ooffff.

-VVCCOOMMMM
   Permit .ccoomm-style data items.  Default is oonn.

-VVFFLLOOAATT
   Include floating  point pprriinnttff  routines.  Same as  -f option,
   above.

-VVLLIINNEESS
   Generate line number information.  Can be used with the option
   -VVAASSMM, described  above, to generate  assembly language output
   that uses line numbers.  Default is ooffff.

-VVQQUUIIEETT
   Suppress all  messages.  Identical  to -Q option.   Default is
   ooffff.

-VVSSBBOOOOKK
   Strict: note  deviations from _T_h_e _C  _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, ed.
   1.  Default is ooffff.

-VVSSCCCCOONN
   Strict: note constant conditional.  Default is ooffff.

-VVSSIINNUU
   Implement  struct-in-union  rules  instead of  Berkeley-member
   resolution rules.   Default is  ooffff, i.e., Berkeley  rules are
   the default.

-VVSSLLCCOONN
   Strict:  iinntt constant  promoted to lloonngg  because value  is too
   big.  Default is oonn.

-VVSSMMEEMMBB
   Strict: check use  of structure/union members for adherence to
   standard rules of C.  Default is oonn.

-VVSSNNRREEGG
   Strict: register declaration reduced to auto.  Default is oonn.

-VVSSPPVVAALL
   Strict: pointer value truncated.  Default is ooffff.

-VVSSRRTTVVCC
   Strict: risky types in truth contexts.  Default is ooffff.

-VVSSTTAATT
   Give statistics on optimization.

-VVSS
   Turn on all strict checking.  Default is oonn.




COHERENT Lexicon                                           Page 5




cc                           Command                           cc



-VVSSUURREEGG
   Strict: note unused registers.  Default is ooffff.

-VVSSUUVVAARR
   Strict: note unused variables.  Default is oonn.

-VV33GGRRAAPPHH
   Translate ANSI trigraphs.  Default is ooffff.

***** See  Also *****  as, C language,  cc0, cc1, cc2,  cc3, com-
mands, cpp, ld
_T_h_e _C _L_a_n_g_u_a_g_e, tutorial













































COHERENT Lexicon                                           Page 6


