home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / man / cat1 / cpp.0 < prev    next >
Text File  |  1993-12-07  |  18KB  |  397 lines

  1.  
  2.  
  3.  
  4. cpp(1)                      GNU Tools                      cpp(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        cccp, cpp - The GNU C-Compatible Compiler Preprocessor.
  9.  
  10. SSYYNNOOPPSSIISS
  11.        ccccccpp   [--$$] [--CC] [--DD_n_a_m_e[==_d_e_f_i_n_i_t_i_o_n]] [--ddDD] [--ddMM]
  12.               [--II _d_i_r_e_c_t_o_r_y] [--HH] [--II--] [--iimmaaccrrooss _f_i_l_e]
  13.               [--iinncclluuddee _f_i_l_e] [--llaanngg--cc] [--llaanngg--cc++++] [--llaanngg--oobbjjcc]
  14.               [--llaanngg--oobbjjcc++++] [--lliinntt] [--MM] [--MMDD] [--MMMM] [--MMMMDD]
  15.               [--nnoossttddiinncc] [--PP] [--ppeeddaannttiicc] [--ppeeddaannttiicc--eerrrroorrss]
  16.               [--ttrriiggrraapphhss] [--UU_n_a_m_e] [--uunnddeeff] [--WWttrriiggrraapphhss]
  17.               [--WWccoommmmeenntt] [--WWaallll] [--WWttrraaddiittiioonnaall]
  18.               [_i_n_f_i_l_e|--] [_o_u_t_f_i_l_e|--]
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.        The C preprocessor is a _m_a_c_r_o _p_r_o_c_e_s_s_o_r that is used auto-
  22.        matically by the C compiler to transform your program  be-
  23.        fore  actual  compilation.  It is called a macro processor
  24.        because it allows you to define _m_a_c_r_o_s,  which  are  brief
  25.        abbreviations for longer constructs.
  26.  
  27.        The  C preprocessor provides four separate facilities that
  28.        you can use as you see fit:
  29.  
  30.        o      Inclusion of header files.  These are files of dec-
  31.               larations  that  can  be substituted into your pro-
  32.               gram.
  33.  
  34.        o      Macro expansion.  You can define _m_a_c_r_o_s, which  are
  35.               abbreviations  for  arbitrary  fragments of C code,
  36.               and then the C preprocessor will replace the macros
  37.               with their definitions throughout the program.
  38.  
  39.        o      Conditional  compilation.  Using special preproces-
  40.               sor commands, you can include or exclude  parts  of
  41.               the program according to various conditions.
  42.  
  43.        o      Line  control.   If you use a program to combine or
  44.               rearrange source files into  an  intermediate  file
  45.               which is then compiled, you can use line control to
  46.               inform the compiler of where each source line orig-
  47.               inally came from.
  48.  
  49.        C preprocessors vary in some details.  For a full explana-
  50.        tion  of  the  GNU  C  preprocessor,  see  the  iinnffoo  file
  51.        `ccpppp..iinnffoo',  or  the  manual  _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r.  Both of
  52.        these are built from the same documentation  source  file,
  53.        `ccpppp..tteexxiinnffoo'.  The GNU C preprocessor provides a superset
  54.        of the features of ANSI Standard C.
  55.  
  56.        ANSI Standard C requires the rejection  of  many  harmless
  57.        constructs  commonly used by today's C programs.  Such in-
  58.        compatibility would be inconvenient for users, so the  GNU
  59.        C preprocessor is configured to accept these constructs by
  60.        default.  Strictly speaking, to get ANSI Standard  C,  you
  61.  
  62.  
  63.  
  64. GNU Tools                    2Jan1992                           1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. cpp(1)                      GNU Tools                      cpp(1)
  71.  
  72.  
  73.        must   use   the   options   `--ttrriiggrraapphhss',   `--uunnddeeff'  and
  74.        `--ppeeddaannttiicc', but in practice the  consequences  of  having
  75.        strict ANSI Standard C make it undesirable to do this.
  76.  
  77.        Most  often  when  you use the C preprocessor you will not
  78.        have to invoke it explicitly: the C compiler  will  do  so
  79.        automatically.   However,  the  preprocessor  is sometimes
  80.        useful individually.
  81.  
  82.        When you call the preprocessor individually,  either  name
  83.        (ccpppp or ccccccpp) will do--they are completely synonymous.
  84.  
  85.        The  C  preprocessor  expects two file names as arguments,
  86.        _i_n_f_i_l_e and _o_u_t_f_i_l_e.  The preprocessor reads _i_n_f_i_l_e togeth-
  87.        er with any other files it specifies with `##iinncclluuddee'.  All
  88.        the output generated by the combined input files is  writ-
  89.        ten in _o_u_t_f_i_l_e.
  90.  
  91.        Either _i_n_f_i_l_e or _o_u_t_f_i_l_e may be `--', which as _i_n_f_i_l_e means
  92.        to read from standard input and as _o_u_t_f_i_l_e means to  write
  93.        to  standard  output.  Also, if _o_u_t_f_i_l_e or both file names
  94.        are omitted, the standard output and  standard  input  are
  95.        used for the omitted file names.
  96.  
  97. OOPPTTIIOONNSS
  98.        Here  is a table of command options accepted by the C pre-
  99.        processor.  These options can also be given when compiling
  100.        a  C  program;  they are passed along automatically to the
  101.        preprocessor when it is invoked by the compiler.
  102.  
  103.        --PP     Inhibit generation of  `##'-lines  with  line-number
  104.               information  in  the  output from the preprocessor.
  105.               This might be useful when running the  preprocessor
  106.               on something that is not C code and will be sent to
  107.               a program which might be confused by the `##'-lines.
  108.  
  109.        --CC     Do  not  discard comments: pass them through to the
  110.               output file.  Comments appearing in arguments of  a
  111.               macro  call will be copied to the output before the
  112.               expansion of the macro call.
  113.  
  114.        --ttrriiggrraapphhss
  115.               Process ANSI standard  trigraph  sequences.   These
  116.               are  three-character  sequences,  all starting with
  117.               `????', that are defined by ANSI C to stand for  sin-
  118.               gle characters.  For example, `????//' stands for `\\',
  119.               so `''????//nn''' is a character constant for a  newline.
  120.               Strictly  speaking, the GNU C preprocessor does not
  121.               support all programs  in  ANSI  Standard  C  unless
  122.               `--ttrriiggrraapphhss'  is  used,  but if you ever notice the
  123.               difference it will be with relief.
  124.  
  125.               You don't want to know any more about trigraphs.
  126.  
  127.  
  128.  
  129.  
  130. GNU Tools                    2Jan1992                           2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. cpp(1)                      GNU Tools                      cpp(1)
  137.  
  138.  
  139.        --ppeeddaannttiicc
  140.               Issue warnings required by the ANSI C  standard  in
  141.               certain  cases  such as when text other than a com-
  142.               ment follows `##eellssee' or `##eennddiiff'.
  143.  
  144.        --ppeeddaannttiicc--eerrrroorrss
  145.               Like `--ppeeddaannttiicc', except that errors  are  produced
  146.               rather than warnings.
  147.  
  148.        --WWttrriiggrraapphhss
  149.               Warn  if  any  trigraphs  are encountered (assuming
  150.               they are enabled).
  151.  
  152.        --WWccoommmmeenntt
  153.  
  154.        --WWccoommmmeennttss
  155.               Warn whenever a comment-start sequence `//**' appears
  156.               in a comment.  (Both forms have the same effect).
  157.  
  158.        --WWaallll  Requests  both  `--WWttrriiggrraapphhss'  and `--WWccoommmmeenntt' (but
  159.               not `--WWttrraaddiittiioonnaall').
  160.  
  161.        --WWttrraaddiittiioonnaall
  162.               Warn about certain constructs that  behave  differ-
  163.               ently in traditional and ANSI C.
  164.  
  165.        --II _d_i_r_e_c_t_o_r_y
  166.                Add the directory _d_i_r_e_c_t_o_r_y to the end of the list
  167.               of directories to be  searched  for  header  files.
  168.               This  can be used to override a system header file,
  169.               substituting your own version, since these directo-
  170.               ries are searched before the system header file di-
  171.               rectories.  If you use more than one  `--II'  option,
  172.               the directories are scanned in left-to-right order;
  173.               the standard system directories come after.
  174.  
  175.        --I