home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / gcc-2.6.0-src.lha / GNU / src / amiga / gcc-2.6.0 / cpp.info-3 < prev    next >
Encoding:
GNU Info File  |  1994-07-14  |  19.5 KB  |  457 lines

  1. This is Info file cpp.info, produced by Makeinfo-1.54 from the input
  2. file cpp.texi.
  3.  
  4.    This file documents the GNU C Preprocessor.
  5.  
  6.    Copyright 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the entire resulting derived work is distributed under the terms
  15. of a permission notice identical to this one.
  16.  
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions.
  20.  
  21. 
  22. File: cpp.info,  Node: Invocation,  Next: Concept Index,  Prev: Output,  Up: Top
  23.  
  24. Invoking the C Preprocessor
  25. ===========================
  26.  
  27.    Most often when you use the C preprocessor you will not have to
  28. invoke it explicitly: the C compiler will do so automatically.
  29. However, the preprocessor is sometimes useful on its own.
  30.  
  31.    The C preprocessor expects two file names as arguments, INFILE and
  32. OUTFILE.  The preprocessor reads INFILE together with any other files
  33. it specifies with `#include'.  All the output generated by the combined
  34. input files is written in OUTFILE.
  35.  
  36.    Either INFILE or OUTFILE may be `-', which as INFILE means to read
  37. from standard input and as OUTFILE means to write to standard output.
  38. Also, if OUTFILE or both file names are omitted, the standard output
  39. and standard input are used for the omitted file names.
  40.  
  41.    Here is a table of command options accepted by the C preprocessor.
  42. These options can also be given when compiling a C program; they are
  43. passed along automatically to the preprocessor when it is invoked by the
  44. compiler.
  45.  
  46. `-P'
  47.      Inhibit generation of `#'-lines with line-number information in
  48.      the output from the preprocessor (*note Output::.).  This might be
  49.      useful when running the preprocessor on something that is not C
  50.      code and will be sent to a program which might be confused by the
  51.      `#'-lines.
  52.  
  53. `-C'
  54.      Do not discard comments: pass them through to the output file.
  55.      Comments appearing in arguments of a macro call will be copied to
  56.      the output before the expansion of the macro call.
  57.  
  58. `-traditional'
  59.      Try to imitate the behavior of old-fashioned C, as opposed to ANSI
  60.      C.
  61.  
  62.         * Traditional macro expansion pays no attention to singlequote
  63.           or doublequote characters; macro argument symbols are
  64.           replaced by the argument values even when they appear within
  65.           apparent string or character constants.
  66.  
  67.         * Traditionally, it is permissible for a macro expansion to end
  68.           in the middle of a string or character constant.  The
  69.           constant continues into the text surrounding the macro call.
  70.  
  71.         * However, traditionally the end of the line terminates a
  72.           string or character constant, with no error.
  73.  
  74.         * In traditional C, a comment is equivalent to no text at all.
  75.           (In ANSI C, a comment counts as whitespace.)
  76.  
  77.         * Traditional C does not have the concept of a "preprocessing
  78.           number".  It considers `1.0e+4' to be three tokens: `1.0e',
  79.           `+', and `4'.
  80.  
  81.         * A macro is not suppressed within its own definition, in
  82.           traditional C.  Thus, any macro that is used recursively
  83.           inevitably causes an error.
  84.  
  85.         * The character `#' has no special meaning within a macro
  86.           definition in traditional C.
  87.  
  88.         * In traditional C, the text at the end of a macro expansion
  89.           can run together with the text after the macro call, to
  90.           produce a single token.  (This is impossible in ANSI C.)
  91.  
  92.         * Traditionally, `\' inside a macro argument suppresses the
  93.           syntactic significance of the following character.
  94.  
  95. `-trigraphs'
  96.      Process ANSI standard trigraph sequences.  These are
  97.      three-character sequences, all starting with `??', that are
  98.      defined by ANSI C to stand for single characters.  For example,
  99.      `??/' stands for `\', so `'??/n'' is a character constant for a
  100.      newline.  Strictly speaking, the GNU C preprocessor does not
  101.      support all programs in ANSI Standard C unless `-trigraphs' is
  102.      used, but if you ever notice the difference it will be with relief.
  103.  
  104.      You don't want to know any more about trigraphs.
  105.  
  106. `-pedantic'
  107.      Issue warnings required by the ANSI C standard in certain cases
  108.      such as when text other than a comment follows `#else' or `#endif'.
  109.  
  110. `-pedantic-errors'
  111.      Like `-pedantic', except that errors are produced rather than
  112.      warnings.
  113.  
  114. `-Wtrigraphs'
  115.      Warn if any trigraphs are encountered (assuming they are enabled).
  116.  
  117. `-Wcomment'
  118.      Warn whenever a comment-start sequence `/*' appears in a comment.
  119.  
  120. `-Wall'
  121.      Requests both `-Wtrigraphs' and `-Wcomment' (but not
  122.      `-Wtraditional').
  123.  
  124. `-Wtraditional'
  125.      Warn about certain constructs that behave differently in
  126.      traditional and ANSI C.
  127.  
  128. `-I DIRECTORY'
  129.      Add the directory DIRECTORY to the end of the list of directories
  130.      to be searched for header files (*note Include Syntax::.).  This
  131.      can be used to override a system header file, substituting your
  132.      own version, since these directories are searched before the system
  133.      header file directories.  If you use more than one `-I' option,
  134.      the directories are scanned in left-to-right order; the standard
  135.      system directories come after.
  136.  
  137. `-I-'
  138.      Any directories specified with `-I' options before the `-I-'
  139.      option are searched only for the case of `#include "FILE"'; they
  140.      are not searched for `#include <FILE>'.
  141.  
  142.      If additional directories are specified with `-I' options after
  143.      the `-I-', these directories are searched for all `#include'
  144.      commands.
  145.  
  146.      In addition, the `-I-' option inhibits the use of the current
  147.      directory as the first search directory for `#include "FILE"'.
  148.      Therefore, the current directory is searched only if it is
  149.      requested explicitly with `-I.'.  Specifying both `-I-' and `-I.'
  150.      allows you to control precisely which directories are searched
  151.      before the current one and which are searched after.
  152.  
  153. `-nostdinc'
  154.      Do not search the standard system directories for header files.
  155.      Only the directories you have specified with `-I' options (and the
  156.      current directory, if appropriate) are searched.
  157.  
  158. `-nostdinc++'
  159.      Do not search for header files in the C++-specific standard
  160.      directories, but do still search the other standard directories.
  161.      (This option is used when building libg++.)
  162.  
  163. `-D NAME'
  164.      Predefine NAME as a macro, with definition `1'.
  165.  
  166. `-D NAME=DEFINITION'
  167.      Predefine NAME as a macro, with definition DEFINITION.  There are
  168.      no restrictions on the contents of DEFINITION, but if you are
  169.      invoking the preprocessor from a shell or shell-like program you
  170.      may need to use the shell's quoting syntax to protect characters
  171.      such as spaces that have a meaning in the shell syntax.  If you
  172.      use more than one `-D' for the same NAME, the rightmost definition
  173.      takes effect.
  174.  
  175. `-U NAME'
  176.      Do not predefine NAME.  If both `-U' and `-D' are specified for
  177.      one name, the `-U' beats the `-D' and the name is not predefined.
  178.  
  179. `-undef'
  180.      Do not predefine any nonstandard macros.
  181.  
  182. `-A PREDICATE(ANSWER)'
  183.      Make an assertion with the predicate PREDICATE and answer ANSWER.
  184.      *Note Assertions::.
  185.  
  186.      You can use `-A-' to disable all predefined assertions; it also
  187.      undefines all predefined macros that identify the type of target
  188.      system.
  189.  
  190. `-dM'
  191.      Instead of outputting the result of preprocessing, output a list of
  192.      `#define' commands for all the macros defined during the execution
  193.      of the preprocessor, including predefined macros.  This gives you
  194.      a way of finding out what is predefined in your version of the
  195.      preprocessor; assuming you have no file `foo.h', the command
  196.  
  197.           touch foo.h; cpp -dM foo.h
  198.  
  199.      will show the values of any predefined macros.
  200.  
  201. `-dD'
  202.      Like `-dM' except in two respects: it does *not* include the
  203.      predefined macros, and it outputs *both* the `#define' commands
  204.      and the result of preprocessing.  Both kinds of output go to the
  205.      standard output file.
  206.  
  207. `-M [-MG]'
  208.      Instead of outputting the result of preprocessing, output a rule
  209.      suitable for `make' describing the dependencies of the main source
  210.      file.  The preprocessor outputs one `make' rule containing the
  211.      object file name for that source file, a colon, and the names of
  212.      all the included files.  If there are many included files then the
  213.      rule is split into several lines using `\'-newline.
  214.  
  215.      `-MG' says to treat missing header files as generated files and
  216.      assume they live in the same directory as the source file.  It
  217.      must be specified in addition to `-M'.
  218.  
  219.      This feature is used in automatic updating of makefiles.
  220.  
  221. `-MM [-MG]'
  222.      Like `-M' but mention only the files included with `#include
  223.      "FILE"'.  System header files included with `#include <FILE>' are
  224.      omitted.
  225.  
  226. `-MD FILE'
  227.      Like `-M' but the dependency information is written to FILE.  This
  228.      is in addition to compiling the file as specified--`-MD' does not
  229.      inhibit ordinary compilation the way `-M' does.
  230.  
  231.      When invoking gcc, do not specify the FILE argument.  Gcc will
  232.      create file names made by replacing ".c" with ".d" at the end of
  233.      the input file names.
  234.  
  235.      In Mach, you can use the utility `md' to merge multiple dependency
  236.      files into a single dependency file suitable for using with the
  237.      `make' command.
  238.  
  239. `-MMD FILE'
  240.      Like `-MD' except mention only user header files, not system
  241.      header files.
  242.  
  243. `-H'
  244.      Print the name of each header file used, in addition to other
  245.      normal activities.
  246.  
  247. `-imacros FILE'
  248.      Process FILE as input, discarding the resulting output, before
  249.      processing the regular input file.  Because the output generated
  250.      from FILE is discarded, the only effect of `-imacros FILE' is to
  251.      make the macros defined in FILE available for use in the main
  252.      input.
  253.  
  254. `-include FILE'
  255.      Process FILE as input, and include all the resulting output,
  256.      before processing the regular input file.
  257.  
  258. `-idirafter DIR'
  259.      Add the directory DIR to the second include path.  The directories
  260.      on the second include path are searched when a header file is not
  261.      found in any of the directories in the main include path (the one
  262.      that `-I' adds to).
  263.  
  264. `-iprefix PREFIX'
  265.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  266.  
  267. `-iwithprefix DIR'
  268.      Add a directory to the second include path.  The directory's name
  269.      is made by concatenating PREFIX and DIR, where PREFIX was
  270.      specified previously with `-iprefix'.
  271.  
  272. `-isystem DIR'
  273.      Add a directory to the beginning of the second include path,
  274.      marking it as a system directory, so that it gets the same special
  275.      treatment as is applied to the standard system directories.
  276.  
  277. `-lang-c'
  278. `-lang-c++'
  279. `-lang-objc'
  280. `-lang-objc++'
  281.      Specify the source language.  `-lang-c++' makes the preprocessor
  282.      handle C++ comment syntax (comments may begin with `//', in which
  283.      case they end at end of line), and includes extra default include
  284.      directories for C++; and `-lang-objc' enables the Objective C
  285.      `#import' command.  `-lang-c' explicitly turns off both of these
  286.      extensions, and `-lang-objc++' enables both.
  287.  
  288.      These options are generated by the compiler driver `gcc', but not
  289.      passed from the `gcc' command line.
  290.  
  291. `-lint'
  292.      Look for commands to the program checker `lint' embedded in
  293.      comments, and emit them preceded by `#pragma lint'.  For example,
  294.      the comment `/* NOTREACHED */' becomes `#pragma lint NOTREACHED'.
  295.  
  296.      This option is available only when you call `cpp' directly; `gcc'
  297.      will not pass it from its command line.
  298.  
  299. `-$'
  300.      Forbid the use of `$' in identifiers.  This is required for ANSI
  301.      conformance.  `gcc' automatically supplies this option to the
  302.      preprocessor if you specify `-ansi', but `gcc' doesn't recognize
  303.      the `-$' option itself--to use it without the other effects of
  304.      `-ansi', you must call the preprocessor directly.
  305.  
  306. 
  307. File: cpp.info,  Node: Concept Index,  Next: Index,  Prev: Invocation,  Up: Top
  308.  
  309. Concept Index
  310. *************
  311.  
  312. * Menu:
  313.  
  314. * ##:                                   Concatenation.
  315. * arguments in macro definitions:       Argument Macros.
  316. * assertions:                           Assertions.
  317. * assertions, undoing:                  Assertions.
  318. * blank macro arguments:                Argument Macros.
  319. * cascaded macros:                      Cascaded Macros.
  320. * commands:                             Commands.
  321. * commenting out code:                  Deleted Code.
  322. * computed #include:                    Include Syntax.
  323. * concatenation:                        Concatenation.
  324. * conditionals:                         Conditionals.
  325. * expansion of arguments:               Argument Prescan.
  326. * function-like macro:                  Argument Macros.
  327. * header file:                          Header Files.
  328. * including just once:                  Once-Only.
  329. * inheritance:                          Inheritance.
  330. * invocation of the preprocessor:       Invocation.
  331. * line control:                         Combining Sources.
  332. * macro argument expansion:             Argument Prescan.
  333. * macro body uses macro:                Cascaded Macros.
  334. * macros with argument:                 Argument Macros.
  335. * manifest constant:                    Simple Macros.
  336. * newlines in macro arguments:          Newlines in Args.
  337. * null command:                         Other Commands.
  338. * options:                              Invocation.
  339. * output format:                        Output.
  340. * overriding a header file:             Inheritance.
  341. * parentheses in macro bodies:          Macro Parentheses.
  342. * pitfalls of macros:                   Macro Pitfalls.
  343. * predefined macros:                    Predefined.
  344. * predicates:                           Assertions.
  345. * preprocessor commands:                Commands.
  346. * prescan of macro arguments:           Argument Prescan.
  347. * problems with macros:                 Macro Pitfalls.
  348. * redefining macros:                    Redefining.
  349. * repeated inclusion:                   Once-Only.
  350. * retracting assertions:                Assertions.
  351. * second include path:                  Invocation.
  352. * self-reference:                       Self-Reference.
  353. * semicolons (after macro calls):       Swallow Semicolon.
  354. * side effects (in macro arguments):    Side Effects.
  355. * simple macro:                         Simple Macros.
  356. * space as macro argument:              Argument Macros.
  357. * standard predefined macros:           Standard Predefined.
  358. * stringification:                      Stringification.
  359. * testing predicates:                   Assertions.
  360. * unassert:                             Assertions.
  361. * undefining macros:                    Undefining.
  362. * unsafe macros:                        Side Effects.
  363.  
  364. 
  365. File: cpp.info,  Node: Index,  Prev: Concept Index,  Up: Top
  366.  
  367. Index of Commands, Macros and Options
  368. *************************************
  369.  
  370. * Menu:
  371.  
  372. * #assert:                              Assertions.
  373. * #cpu:                                 Assertions.
  374. * #define:                              Argument Macros.
  375. * #elif:                                #elif Command.
  376. * #else:                                #else Command.
  377. * #error:                               #error Command.
  378. * #ident:                               Other Commands.
  379. * #if:                                  Conditional Syntax.
  380. * #ifdef:                               Conditionals-Macros.
  381. * #ifndef:                              Conditionals-Macros.
  382. * #import:                              Once-Only.
  383. * #include:                             Include Syntax.
  384. * #include_next:                        Inheritance.
  385. * #line:                                Combining Sources.
  386. * #machine:                             Assertions.
  387. * #pragma:                              Other Commands.
  388. * #pragma once:                         Once-Only.
  389. * #system:                              Assertions.
  390. * #unassert:                            Assertions.
  391. * #warning:                             #error Command.
  392. * -$:                                   Invocation.
  393. * -A:                                   Invocation.
  394. * -C:                                   Invocation.
  395. * -D:                                   Invocation.
  396. * -dD:                                  Invocation.
  397. * -dM:                                  Invocation.
  398. * -H:                                   Invocation.
  399. * -I:                                   Invocation.
  400. * -idirafter:                           Invocation.
  401. * -imacros:                             Invocation.
  402. * -include:                             Invocation.
  403. * -iprefix:                             Invocation.
  404. * -isystem:                             Invocation.
  405. * -iwithprefix:                         Invocation.
  406. * -lang-c:                              Invocation.
  407. * -lang-c++:                            Invocation.
  408. * -lang-objc:                           Invocation.
  409. * -lang-objc++:                         Invocation.
  410. * -M:                                   Invocation.
  411. * -MD:                                  Invocation.
  412. * -MM:                                  Invocation.
  413. * -MMD:                                 Invocation.
  414. * -nostdinc:                            Invocation.
  415. * -nostdinc++:                          Invocation.
  416. * -P:                                   Invocation.
  417. * -pedantic:                            Invocation.
  418. * -pedantic-errors:                     Invocation.
  419. * -traditional:                         Invocation.
  420. * -trigraphs:                           Invocation.
  421. * -U:                                   Invocation.
  422. * -undef:                               Invocation.
  423. * -Wall:                                Invocation.
  424. * -Wcomment:                            Invocation.
  425. * -Wtraditional:                        Invocation.
  426. * -Wtrigraphs:                          Invocation.
  427. * BSD:                                  Nonstandard Predefined.
  428. * defined:                              Conditionals-Macros.
  429. * M68020:                               Nonstandard Predefined.
  430. * m68k:                                 Nonstandard Predefined.
  431. * mc68000:                              Nonstandard Predefined.
  432. * ns32000:                              Nonstandard Predefined.
  433. * pyr:                                  Nonstandard Predefined.
  434. * sequent:                              Nonstandard Predefined.
  435. * sun:                                  Nonstandard Predefined.
  436. * system header files:                  Header Uses.
  437. * unix:                                 Nonstandard Predefined.
  438. * vax:                                  Nonstandard Predefined.
  439. * _AM29000:                             Nonstandard Predefined.
  440. * _AM29K:                               Nonstandard Predefined.
  441. * __BASE_FILE__:                        Standard Predefined.
  442. * __CHAR_UNSIGNED__:                    Standard Predefined.
  443. * __cplusplus:                          Standard Predefined.
  444. * __DATE__:                             Standard Predefined.
  445. * __FILE__:                             Standard Predefined.
  446. * __GNUC__:                             Standard Predefined.
  447. * __GNUG__:                             Standard Predefined.
  448. * __INCLUDE_LEVEL_:                     Standard Predefined.
  449. * __LINE__:                             Standard Predefined.
  450. * __OPTIMIZE__:                         Standard Predefined.
  451. * __STDC__:                             Standard Predefined.
  452. * __STRICT_ANSI__:                      Standard Predefined.
  453. * __TIME__:                             Standard Predefined.
  454. * __VERSION__:                          Standard Predefined.
  455.  
  456.  
  457.