home *** CD-ROM | disk | FTP | other *** search
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- NNAAMMEE
- cccp, cpp - The GNU C-Compatible Compiler Preprocessor.
-
- SSYYNNOOPPSSIISS
- ccccccpp [--$$] [--CC] [--DD_n_a_m_e[==_d_e_f_i_n_i_t_i_o_n]] [--ddDD] [--ddMM]
- [--II _d_i_r_e_c_t_o_r_y] [--HH] [--II--] [--iimmaaccrrooss _f_i_l_e]
- [--iinncclluuddee _f_i_l_e] [--llaanngg--cc] [--llaanngg--cc++++] [--llaanngg--oobbjjcc]
- [--llaanngg--oobbjjcc++++] [--lliinntt] [--MM] [--MMDD] [--MMMM] [--MMMMDD]
- [--nnoossttddiinncc] [--PP] [--ppeeddaannttiicc] [--ppeeddaannttiicc--eerrrroorrss]
- [--ttrriiggrraapphhss] [--UU_n_a_m_e] [--uunnddeeff] [--WWttrriiggrraapphhss]
- [--WWccoommmmeenntt] [--WWaallll] [--WWttrraaddiittiioonnaall]
- [_i_n_f_i_l_e|--] [_o_u_t_f_i_l_e|--]
-
- DDEESSCCRRIIPPTTIIOONN
- The C preprocessor is a _m_a_c_r_o _p_r_o_c_e_s_s_o_r that is used auto-
- matically by the C compiler to transform your program be-
- fore actual compilation. It is called a macro processor
- because it allows you to define _m_a_c_r_o_s, which are brief
- abbreviations for longer constructs.
-
- The C preprocessor provides four separate facilities that
- you can use as you see fit:
-
- o Inclusion of header files. These are files of dec-
- larations that can be substituted into your pro-
- gram.
-
- o Macro expansion. You can define _m_a_c_r_o_s, which are
- abbreviations for arbitrary fragments of C code,
- and then the C preprocessor will replace the macros
- with their definitions throughout the program.
-
- o Conditional compilation. Using special preproces-
- sor commands, you can include or exclude parts of
- the program according to various conditions.
-
- o Line control. If you use a program to combine or
- rearrange source files into an intermediate file
- which is then compiled, you can use line control to
- inform the compiler of where each source line orig-
- inally came from.
-
- C preprocessors vary in some details. For a full explana-
- tion of the GNU C preprocessor, see the iinnffoo file
- `ccpppp..iinnffoo', or the manual _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r. Both of
- these are built from the same documentation source file,
- `ccpppp..tteexxiinnffoo'. The GNU C preprocessor provides a superset
- of the features of ANSI Standard C.
-
- ANSI Standard C requires the rejection of many harmless
- constructs commonly used by today's C programs. Such in-
- compatibility would be inconvenient for users, so the GNU
- C preprocessor is configured to accept these constructs by
- default. Strictly speaking, to get ANSI Standard C, you
-
-
-
- GNU Tools 2Jan1992 1
-
-
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- must use the options `--ttrriiggrraapphhss', `--uunnddeeff' and
- `--ppeeddaannttiicc', but in practice the consequences of having
- strict ANSI Standard C make it undesirable to do this.
-
- Most often when you use the C preprocessor you will not
- have to invoke it explicitly: the C compiler will do so
- automatically. However, the preprocessor is sometimes
- useful individually.
-
- When you call the preprocessor individually, either name
- (ccpppp or ccccccpp) will do--they are completely synonymous.
-
- The C preprocessor expects two file names as arguments,
- _i_n_f_i_l_e and _o_u_t_f_i_l_e. The preprocessor reads _i_n_f_i_l_e togeth-
- er with any other files it specifies with `##iinncclluuddee'. All
- the output generated by the combined input files is writ-
- ten in _o_u_t_f_i_l_e.
-
- 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
- to read from standard input and as _o_u_t_f_i_l_e means to write
- to standard output. Also, if _o_u_t_f_i_l_e or both file names
- are omitted, the standard output and standard input are
- used for the omitted file names.
-
- OOPPTTIIOONNSS
- Here is a table of command options accepted by the C pre-
- processor. These options can also be given when compiling
- a C program; they are passed along automatically to the
- preprocessor when it is invoked by the compiler.
-
- --PP Inhibit generation of `##'-lines with line-number
- information in the output from the preprocessor.
- This might be useful when running the preprocessor
- on something that is not C code and will be sent to
- a program which might be confused by the `##'-lines.
-
- --CC Do not discard comments: pass them through to the
- output file. Comments appearing in arguments of a
- macro call will be copied to the output before the
- expansion of the macro call.
-
- --ttrriiggrraapphhss
- Process ANSI standard trigraph sequences. These
- are three-character sequences, all starting with
- `????', that are defined by ANSI C to stand for sin-
- gle characters. For example, `????//' stands for `\\',
- so `''????//nn''' is a character constant for a newline.
- Strictly speaking, the GNU C preprocessor does not
- support all programs in ANSI Standard C unless
- `--ttrriiggrraapphhss' is used, but if you ever notice the
- difference it will be with relief.
-
- You don't want to know any more about trigraphs.
-
-
-
-
- GNU Tools 2Jan1992 2
-
-
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- --ppeeddaannttiicc
- Issue warnings required by the ANSI C standard in
- certain cases such as when text other than a com-
- ment follows `##eellssee' or `##eennddiiff'.
-
- --ppeeddaannttiicc--eerrrroorrss
- Like `--ppeeddaannttiicc', except that errors are produced
- rather than warnings.
-
- --WWttrriiggrraapphhss
- Warn if any trigraphs are encountered (assuming
- they are enabled).
-
- --WWccoommmmeenntt
-
- --WWccoommmmeennttss
- Warn whenever a comment-start sequence `//**' appears
- in a comment. (Both forms have the same effect).
-
- --WWaallll Requests both `--WWttrriiggrraapphhss' and `--WWccoommmmeenntt' (but
- not `--WWttrraaddiittiioonnaall').
-
- --WWttrraaddiittiioonnaall
- Warn about certain constructs that behave differ-
- ently in traditional and ANSI C.
-
- --II _d_i_r_e_c_t_o_r_y
- Add the directory _d_i_r_e_c_t_o_r_y to the end of the list
- of directories to be searched for header files.
- This can be used to override a system header file,
- substituting your own version, since these directo-
- ries are searched before the system header file di-
- rectories. If you use more than one `--II' option,
- the directories are scanned in left-to-right order;
- the standard system directories come after.
-
- --II-- Any directories specified with `--II' options before
- the `--II--' option are searched only for the case of
- `##iinncclluuddee _f_i_l_e"'; they are not searched for `##iinn--
- cclluuddee <<_f_i_l_e>'.
-
- If additional directories are specified with `--II'
- options after the `--II--', these directories are
- searched for all `##iinncclluuddee' directives.
-
- In addition, the `--II--' option inhibits the use of
- the current directory as the first search directory
- for `##iinncclluuddee _f_i_l_e"'. Therefore, the current di-
- rectory is searched only if it is requested explic-
- itly with `--II..'. Specifying both `--II--' and `--II..'
- allows you to control precisely which directories
- are searched before the current one and which are
- searched after.
-
-
-
-
- GNU Tools 2Jan1992 3
-
-
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- --nnoossttddiinncc
- Do not search the standard system directories for
- header files. Only the directories you have speci-
- fied with `--II' options (and the current directory,
- if appropriate) are searched.
-
- --DD _n_a_m_e
- Predefine _n_a_m_e as a macro, with definition `11'.
-
- --DD _n_a_m_e==_d_e_f_i_n_i_t_i_o_n
- Predefine _n_a_m_e as a macro, with definition _d_e_f_i_n_i_-
- _t_i_o_n. There are no restrictions on the contents of
- _d_e_f_i_n_i_t_i_o_n, but if you are invoking the preproces-
- sor from a shell or shell-like program you may need
- to use the shell's quoting syntax to protect char-
- acters such as spaces that have a meaning in the
- shell syntax. If you use more than one `--DD' for
- the same _n_a_m_e, the rightmost definition takes ef-
- fect.
-
- --UU _n_a_m_e
- Do not predefine _n_a_m_e. If both `--UU' and `--DD' are
- specified for one name, the `--UU' beats the `--DD' and
- the name is not predefined.
-
- --uunnddeeff Do not predefine any nonstandard macros.
-
- --ddMM Instead of outputting the result of preprocessing,
- output a list of `##ddeeffiinnee' commands for all the
- macros defined during the execution of the prepro-
- cessor, including predefined macros. This gives
- you a way of finding out what is predefined in your
- version of the preprocessor; assuming you have no
- file `ffoooo..hh', the command
-
- touch foo.h; cpp -dM foo.h
-
- will show the values of any predefined macros.
-
- --ddDD Like `--ddMM' except in two respects: it does _n_o_t in-
- clude the predefined macros, and it outputs _b_o_t_h
- the `##ddeeffiinnee' commands and the result of prepro-
- cessing. Both kinds of output go to the standard
- output file.
-
-
- --MM Instead of outputting the result of preprocessing,
- output a rule suitable for mmaakkee describing the de-
- pendencies of the main source file. The preproces-
- sor outputs one mmaakkee rule containing the object
- file name for that source file, a colon, and the
- names of all the included files. If there are many
- included files then the rule is split into several
- lines using `'-newline.
-
-
-
- GNU Tools 2Jan1992 4
-
-
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- This feature is used in automatic updating of make-
- files.
-
- --MMMM Like `--MM' but mention only the files included with
- `##iinncclluuddee "_f_i_l_e"'. System header files included
- with `##iinncclluuddee <_f_i_l_e>' are omitted.
-
- --MMDD Like `--MM' but the dependency information is written
- to files with names made by replacing `..cc' with
- `..dd' at the end of the input file names. This is
- in addition to compiling the file as
- specified--`--MMDD' does not inhibit ordinary compila-
- tion the way `--MM' does.
-
- In Mach, you can use the utility mmdd to merge the
- `..dd' files into a single dependency file suitable
- for using with the `mmaakkee' command.
-
- --MMMMDD Like `--MMDD' except mention only user header files,
- not system header files.
-
- --HH Print the name of each header file used, in addi-
- tion to other normal activities.
-
- --iimmaaccrrooss _f_i_l_e
- Process _f_i_l_e as input, discarding the resulting
- output, before processing the regular input file.
- Because the output generated from _f_i_l_e is discard-
- ed, the only effect of `--iimmaaccrrooss _f_i_l_e' is to make
- the macros defined in _f_i_l_e available for use in the
- main input. The preprocessor evaluates any `--DD'
- and `--UU' options on the command line before pro-
- cessing `--iimmaaccrrooss _f_i_l_e' .
-
- --iinncclluuddee _f_i_l_e
- Process _f_i_l_e as input, and include all the result-
- ing output, before processing the regular input
- file.
-
- --llaanngg--cc
-
- --llaanngg--cc++++
-
- --llaanngg--oobbjjcc
-
- --llaanngg--oobbjjcc++++
- Specify the source language. `--llaanngg--cc++++' makes the
- preprocessor handle C++ comment syntax, and in-
- cludes extra default include directories for C++,
- and `--llaanngg--oobbjjcc' enables the Objective C `##iimmppoorrtt'
- directive. `--llaanngg--cc' explicitly turns off both of
- these extensions, and `--llaanngg--oobbjjcc++++' enables both.
-
- These options are generated by the compiler driver
-
-
-
- GNU Tools 2Jan1992 5
-
-
-
-
-
- cpp(1) GNU Tools cpp(1)
-
-
- ggcccc, but not passed from the `ggcccc' command line.
-
- --lliinntt Look for commands to the program checker lliinntt em-
- bedded in comments, and emit them preceded by
- `##pprraaggmmaa lliinntt'. For example, the comment `//**
- NNOOTTRREEAACCHHEEDD **//' becomes `##pprraaggmmaa lliinntt NOTREACHED'.
-
- This option is available only when you call ccpppp di-
- rectly; ggcccc will not pass it from its command line.
-
- --$$ Forbid the use of `$$' in identifiers. This is re-
- quired for ANSI conformance. ggcccc automatically
- supplies this option to the preprocessor if you
- specify `--aannssii', but ggcccc doesn't recognize the `--$$'
- option itself--to use it without the other effects
- of `--aannssii', you must call the preprocessor direct-
- ly.
-
- SSEEEE AALLSSOO
- `CCpppp' entry in iinnffoo; _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r, Richard M. Stall-
- man.
- ggcccc(11); `GGcccc' entry in iinnffoo; _U_s_i_n_g _a_n_d _P_o_r_t_i_n_g _G_N_U _C_C _(_f_o_r
- _v_e_r_s_i_o_n _2_._0_), Richard M. Stallman.
-
- CCOOPPYYIINNGG
- Copyright (c) 1991, 1992 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim
- copies of this manual provided the copyright notice and
- this permission notice are preserved on all copies.
-
- Permission is granted to copy and distribute modified ver-
- sions of this manual under the conditions for verbatim
- copying, provided that the entire resulting derived work
- is distributed under the terms of a permission notice
- identical to this one.
-
- Permission is granted to copy and distribute translations
- of this manual into another language, under the above con-
- ditions for modified versions, except that this permission
- notice may be included in translations approved by the
- Free Software Foundation instead of in the original En-
- glish.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GNU Tools 2Jan1992 6
-
-
-