home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / man / cat1 / cccp.0 next >
Text File  |  1994-02-08  |  17KB  |  463 lines

  1.  
  2.  
  3.  
  4. cpp(1)                      GNU Tools                      cpp(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      cccp, cpp - The GNU C-Compatible Compiler Preprocessor.
  10.  
  11. SYNOPSIS
  12.      cccp [-$] [-A_p_r_e_d_i_c_a_t_e[(_v_a_l_u_e)]] [-C] [-D_n_a_m_e[=_d_e_f_i_n_i_t_i_o_n]]
  13.           [-dD] [-dM] [-I _d_i_r_e_c_t_o_r_y] [-H] [-I-] [-imacros _f_i_l_e]
  14.           [-include _f_i_l_e] [-idirafter _d_i_r] [-iprefix _p_r_e_f_i_x]
  15.           [-iwithprefix _d_i_r] [-lang-c] [-lang-c++] [-lang-objc]
  16.           [-lang-objc++] [-lint] [-M] [-MD] [-MM] [-MMD]
  17.           [-nostdinc] [-nostdinc++] [-P] [-pedantic]
  18.           [-pedantic-errors] [-traditional] [-trigraphs] [-U_n_a_m_e]
  19.           [-undef] [-Wtrigraphs] [-Wcomment] [-Wall]
  20.           [-Wtraditional]
  21.           [_i_n_f_i_l_e|-] [_o_u_t_f_i_l_e|-]
  22.  
  23. DESCRIPTION
  24.      The C preprocessor is a _m_a_c_r_o _p_r_o_c_e_s_s_o_r  that  is  used  au-
  25.      tomatically  by the C compiler to transform your program be-
  26.      fore actual compilation.  It is called a macro processor be-
  27.      cause it allows you to define _m_a_c_r_o_s, which are brief abbre-
  28.      viations for longer constructs.
  29.  
  30.      The C preprocessor provides four  separate  facilities  that
  31.      you can use as you see fit:
  32.  
  33.      o+    Inclusion of header files.  These are files of declara-
  34.           tions that can be substituted into your program.
  35.  
  36.      o+    Macro expansion.  You can define _m_a_c_r_o_s, which are  ab-
  37.           breviations for arbitrary fragments of C code, and then
  38.           the C preprocessor will replace the macros  with  their
  39.           definitions throughout the program.
  40.  
  41.      o+    Conditional compilation.   Using  special  preprocessor
  42.           commands,  you can include or exclude parts of the pro-
  43.           gram according to various conditions.
  44.  
  45.      o+    Line control.  If you use a program to combine or rear-
  46.           range  source  files into an intermediate file which is
  47.           then compiled, you can use line control to  inform  the
  48.           compiler  of  where  each  source  line originally came
  49.           from.
  50.  
  51.      C preprocessors vary in some details.  For a  full  explana-
  52.      tion   of   the  GNU  C  preprocessor,  see  the  info  file
  53.      `cpp.info', or the manual _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r.  Both of these
  54.      are   built   from   the  same  documentation  source  file,
  55.      `cpp.texinfo'.  The GNU C preprocessor provides  a  superset
  56.      of the features of ANSI Standard C.
  57.  
  58.      ANSI Standard C requires the rejection of many harmless con-
  59.      structs  commonly used by today's C programs.  Such incompa-
  60.  
  61.  
  62.  
  63. GNU Tools            Last change: 30apr1993                     1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. cpp(1)                      GNU Tools                      cpp(1)
  71.  
  72.  
  73.  
  74.      tibility would be inconvenient  for  users,  so  the  GNU  C
  75.      preprocessor is configured to accept these constructs by de-
  76.      fault.  Strictly speaking, to get ANSI Standard C, you  must
  77.      use  the options `-trigraphs', `-undef' and `-pedantic', but
  78.      in practice the consequences of having strict ANSI  Standard
  79.      C make it undesirable to do this.
  80.  
  81.      Most often when you use the C preprocessor you will not have
  82.      to invoke it explicitly: the C compiler will do so automati-
  83.      cally.  However, the preprocessor is sometimes useful  indi-
  84.      vidually.
  85.  
  86.      When you call the  preprocessor  individually,  either  name
  87.      (cpp or cccp) will do-they are completely synonymous.
  88.  
  89.      The C preprocessor expects two file names as arguments,  _i_n_-
  90.      _f_i_l_e  and  _o_u_t_f_i_l_e.   The preprocessor reads _i_n_f_i_l_e together
  91.      with any other files it specifies with `#include'.  All  the
  92.      output  generated  by the combined input files is written in
  93.      _o_u_t_f_i_l_e.
  94.  
  95.      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
  96.      to read from standard input and as _o_u_t_f_i_l_e means to write to
  97.      standard output.  Also, if _o_u_t_f_i_l_e or both  file  names  are
  98.      omitted, the standard output and standard input are used for
  99.      the omitted file names.
  100.  
  101. OPTIONS
  102.      Here is a table of command options accepted by the C prepro-
  103.      cessor.  These  options can also be given when compiling a C
  104.      program; they are passed along automatically to the  prepro-
  105.      cessor when it is invoked by the compiler.
  106.  
  107.      -P   Inhibit generation of `#'-lines with line-number infor-
  108.           mation in the output from the preprocessor.  This might
  109.           be useful when running the  preprocessor  on  something
  110.           that  is not C code and will be sent to a program which
  111.           might be confused by the `#'-lines.
  112.  
  113.      -C   Do not discard comments: pass them through to the  out-
  114.           put  file.   Comments appearing in arguments of a macro
  115.           call will be copied to the output before the  expansion
  116.           of the macro call.
  117.  
  118.      -traditional
  119.           Try to imitate the behavior of old-fashioned C, as  op-
  120.           posed to ANSI C.
  121.  
  122.      -trigraphs
  123.           Process ANSI standard trigraph  sequences.   These  are
  124.           three-character sequences, all starting with `??', that
  125.           are defined by ANSI C to stand for  single  characters.
  126.  
  127.  
  128.  
  129. GNU Tools            Last change: 30apr1993                     2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. cpp(1)                      GNU Tools                      cpp(1)
  137.  
  138.  
  139.  
  140.           For  example,  `??/'  stands  for `\', so `'??/n'' is a
  141.           character constant for a newline.   Strictly  speaking,
  142.           the GNU C preprocessor does not support all programs in
  143.           ANSI Standard C unless `-trigraphs' is used, but if you
  144.           ever notice the difference it will be with relief.
  145.  
  146.           You don't want to know any more about trigraphs.
  147.  
  148.      -pedantic
  149.           Issue warnings required by the ANSI C standard in  cer-
  150.           tain  cases such as when text other than a comment fol-
  151.           lows `#else' or `#endif'.
  152.  
  153.      -pedantic-errors
  154.           Like `-pedantic', except that errors are produced rath-
  155.           er than warnings.
  156.  
  157.      -Wtrigraphs
  158.           Warn if any trigraphs are  encountered  (assuming  they
  159.           are enabled).
  160.  
  161.      -Wcomment
  162.  
  163.      -Wcomments
  164.           Warn whenever a comment-start sequence `/*' appears  in
  165.           a comment.  (Both forms have the same effect).
  166.  
  167.      -Wall
  168.           Requests both `-Wtrigraphs' and  `-Wcomment'  (but  not
  169.           `-Wtraditional').
  170.  
  171.      -Wtraditional
  172.           Warn about certain constructs that  behave  differently
  173.           in traditional and ANSI C.
  174.  
  175.      -I _d_i_r_e_c_t_o_r_y
  176.            Add the directory _d_i_r_e_c_t_o_r_y to the end of the list  of
  177.           directories  to be searched for header files.  This can
  178.           be used to override a system header file,  substituting
  179.           your  own version, since these directories are searched
  180.           before the system header file directories.  If you  use
  181.           more  than one `-I' option, the directories are scanned
  182.           in left-to-right order; the standard system directories
  183.           come after.
  184.  
  185.      -I-  Any directories specified with `-I' options before  the
  186.           `-I-'  option  are  searched only for the case of `#in-
  187.           clude _f_i_l_e"';  they  are  not  searched  for  `#include
  188.           <_f_i_l_e>'.
  189.  
  190.           If additional directories are specified with  `-I'  op-
  191.           tions  after  the `-I-', these directories are searched
  192.  
  193.  
  194.  
  195. GNU Tools            Last change: 30apr1993                     3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. cpp(1)                      GNU Tools                      cpp(1)
  203.  
  204.  
  205.  
  206.           for all `#include' directives.
  207.  
  208.           In addition, the `-I-' option inhibits the use  of  the
  209.           current  directory  as  the  first search directory for
  210.           `#include _f_i_l_e"'.  Therefore, the current directory  is
  211.           searched only if it is requested explicitly with `-I.'.
  212.           Specifying both `-I-' and `-I.' allows you  to  control
  213.           precisely  which  directories  are  searched before the
  214.           current one an