⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cccp.1

📁 早期freebsd实现
💻 1
字号:
.\" Copyright (c) 1991, 1992 Free Software Foundation       \-*-Text-*-.\" See section COPYING for conditions for redistribution.TH cpp 1 "2Jan1992" "GNU Tools" "GNU Tools".SH NAMEcccp, cpp \- the GNU C-compatible compiler preprocessor.SH SYNOPSIS.hy 0.na.TP.B cccp.RB "[\|" \-$ "\|]".RB "[\|" \-C "\|]" .RB "[\|" \-D \c.I name\c.RB [ =\c.I definition\c\&]\|].RB "[\|" \-dD "\|]".RB "[\|" \-dM "\|]".RB "[\|" "\-I\ "\c.I directory\c\&\|].RB "[\|" \-H "\|]".RB "[\|" \-I\- "\|]" .RB "[\|" "\-imacros\ "\c.I file\c\&\|].RB "[\|" "\-include\ "\c.I file\c\&\|].RB "[\|" \-lang\-c "\|]".RB "[\|" \-lang\-c++ "\|]".RB "[\|" \-lang\-objc "\|]".RB "[\|" \-lang\-objc++ "\|]".RB "[\|" \-lint "\|]".RB "[\|" \-M "\|]" .RB "[\|" \-MD "\|]" .RB "[\|" \-MM "\|]" .RB "[\|" \-MMD "\|]" .RB "[\|" \-nostdinc "\|]" .RB "[\|" \-P "\|]" .RB "[\|" \-pedantic "\|]".RB "[\|" \-pedantic\-errors "\|]".RB "[\|" \-trigraphs "\|]" .RB "[\|" \-U \c.I name\c\&\|].RB "[\|" \-undef "\|]".RB "[\|" \-Wtrigraphs "\|]".RB "[\|" \-Wcomment "\|]".RB "[\|" \-Wall "\|]".RB "[\|" \-Wtraditional "\|]".br.RB "[\|" \c.I infile\c.RB | \- "\|]" .RB "[\|" \c.I outfile\c.RB | \- "\|]"  .ad b.hy 1.SH DESCRIPTIONThe C preprocessor is a \c.I macro processor\c\& that is used automatically bythe C compiler to transform your program before actual compilation.  It iscalled a macro processor because it allows you to define \c.I macros\c\&,which are brief abbreviations for longer constructs.The C preprocessor provides four separate facilities that you can use asyou see fit:.TP\(buInclusion of header files.  These are files of declarations that can besubstituted into your program..TP\(buMacro expansion.  You can define \c.I macros\c\&, which are abbreviationsfor arbitrary fragments of C code, and then the C preprocessor willreplace the macros with their definitions throughout the program..TP\(buConditional compilation.  Using special preprocessor commands, youcan include or exclude parts of the program according to variousconditions..TP\(buLine control.  If you use a program to combine or rearrange source files intoan intermediate file which is then compiled, you can use line controlto inform the compiler of where each source line originally came from..PPC preprocessors vary in some details.  For a full explanation of theGNU C preprocessor, see the.B infofile `\|\c.B cpp.info\c\&\|', or the manual.I The C Preprocessor\c\&.  Both of these are built from the same documentation source file, `\|\c.B cpp.texinfo\c\&\|'.  The GNU Cpreprocessor provides a superset of the features of ANSI Standard C.ANSI Standard C requires the rejection of many harmless constructs commonlyused by today's C programs.  Such incompatibility would be inconvenient forusers, so the GNU C preprocessor is configured to accept these constructsby default.  Strictly speaking, to get ANSI Standard C, you must use theoptions `\|\c.B \-trigraphs\c\&\|', `\|\c.B \-undef\c\&\|' and `\|\c.B \-pedantic\c\&\|', but inpractice the consequences of having strict ANSI Standard C make itundesirable to do this.  Most often when you use the C preprocessor you will not have to invoke itexplicitly: the C compiler will do so automatically.  However, thepreprocessor is sometimes useful individually.When you call the preprocessor individually, either name(\c.B cpp\c\& or \c.B cccp\c\&) will do\(em\&they are completely synonymous.The C preprocessor expects two file names as arguments, \c.I infile\c\& and\c.I outfile\c\&.  The preprocessor reads \c.I infile\c\& together with any otherfiles it specifies with `\|\c.B #include\c\&\|'.  All the output generated by thecombined input files is written in \c.I outfile\c\&.Either \c.I infile\c\& or \c.I outfile\c\& may be `\|\c.B \-\c\&\|', which as \c.I infile\c\&means to read from standard input and as \c.I outfile\c\& means to write tostandard output.  Also, if \c.I outfile\c\& or both file names are omitted,the standard output and standard input are used for the omitted file names..SH OPTIONSHere is a table of command options accepted by the C preprocessor.  These options can also be given when compiling a C program; they arepassed along automatically to the preprocessor when it is invoked bythe compiler. .TP.B \-PInhibit generation of `\|\c.B #\c\&\|'-lines with line-number information inthe output from the preprocessor.  This might beuseful when running the preprocessor on something that is not C codeand will be sent to a program which might be confused by the`\|\c.B #\c\&\|'-lines..TP.B \-CDo not discard comments: pass them through to the output file.Comments appearing in arguments of a macro call will be copied to theoutput before the expansion of the macro call..TP.B \-trigraphsProcess ANSI standard trigraph sequences.  These are three-charactersequences, all starting with `\|\c.B ??\c\&\|', that are defined by ANSI C tostand for single characters.  For example, `\|\c.B ??/\c\&\|' stands for`\|\c.BR "\e" "\|',"so `\|\c.B '??/n'\c\&\|' is a character constant for a newline.Strictly speaking, the GNU C preprocessor does not support allprograms in ANSI Standard C unless `\|\c.B \-trigraphs\c\&\|' is used, but ifyou ever notice the difference it will be with relief.You don't want to know any more about trigraphs..TP.B \-pedanticIssue warnings required by the ANSI C standard in certain cases suchas when text other than a comment follows `\|\c.B #else\c\&\|' or `\|\c.B #endif\c\&\|'..TP.B \-pedantic\-errorsLike `\|\c.B \-pedantic\c\&\|', except that errors are produced rather thanwarnings..TP.B \-WtrigraphsWarn if any trigraphs are encountered (assuming they are enabled)..TP.B \-Wcomment.TP.B \-WcommentsWarn whenever a comment-start sequence `\|\c.B /*\c\&\|' appears in a comment.(Both forms have the same effect)..TP.B \-WallRequests both `\|\c.B \-Wtrigraphs\c\&\|' and `\|\c.B \-Wcomment\c\&\|' (but not`\|\c.B \-Wtraditional\c\&\|'). .TP.B \-WtraditionalWarn about certain constructs that behave differently in traditional andANSI C..TP.BI "\-I " directory\c\&Add the directory \c.I directory\c\& to the end of the list ofdirectories to be searched for header files.This can be used to override a system header file, substituting yourown version, since these directories are searched before the systemheader file directories.  If you use more than one `\|\c.B \-I\c\&\|' option,the directories are scanned in left-to-right order; the standardsystem directories come after..TP.B \-I\-Any directories specified with `\|\c.B \-I\c\&\|' options before the `\|\c.B \-I\-\c\&\|'option are searched only for the case of `\|\c.B #include "\c.I file\c\&"\c\&\|';they are not searched for `\|\c.B #include <\c.I file\c\&>\c\&\|'.If additional directories are specified with `\|\c.B \-I\c\&\|' options afterthe `\|\c.B \-I\-\c\&\|', these directories are searched for all `\|\c.B #include\c\&\|'directives.In addition, the `\|\c.B \-I\-\c\&\|' option inhibits the use of the currentdirectory as the first search directory for `\|\c.B #include "\c.I file\c\&"\c\&\|'.Therefore, the current directory is searched only if it is requestedexplicitly with `\|\c.B \-I.\c\&\|'.  Specifying both `\|\c.B \-I\-\c\&\|' and `\|\c.B \-I.\c\&\|'allows you to control precisely which directories are searched beforethe current one and which are searched after..TP.B \-nostdincDo not search the standard system directories for header files.Only the directories you have specified with `\|\c.B \-I\c\&\|' options(and the current directory, if appropriate) are searched..TP.BI "\-D " "name"\c\&Predefine \c.I name\c\& as a macro, with definition `\|\c.B 1\c\&\|'..TP.BI "\-D " "name" = definition\&Predefine \c.I name\c\& as a macro, with definition \c.I definition\c\&.There are no restrictions on the contents of \c.I definition\c\&, but ifyou are invoking the preprocessor from a shell or shell-like programyou may need to use the shell's quoting syntax to protect characterssuch as spaces that have a meaning in the shell syntax.  If you use more thanone `\|\c.B \-D\c\&\|' for the same.I name\c\&, the rightmost definition takes effect..TP.BI "\-U " "name"\c\&Do not predefine \c.I name\c\&.  If both `\|\c.B \-U\c\&\|' and `\|\c.B \-D\c\&\|' arespecified for one name, the `\|\c.B \-U\c\&\|' beats the `\|\c.B \-D\c\&\|' and the nameis not predefined..TP.B \-undefDo not predefine any nonstandard macros..TP.B \-dMInstead of outputting the result of preprocessing, output a list of`\|\c.B #define\c\&\|' commands for all the macros defined during theexecution of the preprocessor, including predefined macros.  This givesyou a way of finding out what is predefined in your version of thepreprocessor; assuming you have no file `\|\c.B foo.h\c\&\|', the command.sp.brtouch\ foo.h;\ cpp\ \-dM\ foo.h.br.spwill show the values of any predefined macros..TP.B \-dDLike `\|\c.B \-dM\c\&\|' except in two respects: it does \c.I not\c\& include thepredefined macros, and it outputs \c.I both\c\& the `\|\c.B #define\c\&\|'commands and the result of preprocessing.  Both kinds of output go tothe standard output file..PP.TP.B \-MInstead of outputting the result of preprocessing, output a rulesuitable for \c.B make\c\& describing the dependencies of the mainsource file.  The preprocessor outputs one \c.B make\c\& rule containingthe object file name for that source file, a colon, and the names ofall the included files.  If there are many included files then therule is split into several lines using `\|\c.B \\c\&\|'-newline.This feature is used in automatic updating of makefiles..TP.B \-MMLike `\|\c.B \-M\c\&\|' but mention only the files included with `\|\c.B #include"\c.I file\c\&"\c\&\|'.  System header files included with `\|\c.B #include<\c.I file\c\&>\c\&\|' are omitted..TP.B \-MDLike `\|\c.B \-M\c\&\|' but the dependency information is written to files withnames made by replacing `\|\c.B .c\c\&\|' with `\|\c.B .d\c\&\|' at the end of theinput file names.  This is in addition to compiling the file asspecified\(em\&`\|\c.B \-MD\c\&\|' does not inhibit ordinary compilation the way`\|\c.B \-M\c\&\|' does.In Mach, you can use the utility \c.B md\c\& to merge the `\|\c.B .d\c\&\|' filesinto a single dependency file suitable for using with the `\|\c.B make\c\&\|'command..TP.B \-MMDLike `\|\c.B \-MD\c\&\|' except mention only user header files, not systemheader files..TP.B \-HPrint the name of each header file used, in addition to other normalactivities..TP.BI "\-imacros " "file"\c\&Process \c.I file\c\& as input, discarding the resulting output, beforeprocessing the regular input file.  Because the output generated from\c.I file\c\& is discarded, the only effect of `\|\c.B \-imacros \c.I file\c\&\c\&\|' is tomake the macros defined in \c.I file\c\& available for use in the maininput.  The preprocessor evaluates any `\|\c.B \-D\c\&\|' and `\|\c.B \-U\c\&\|' optionson the command line before processing `\|\c.B \-imacros \c.I file\c\&\|' \c\&..TP.BI "\-include " "file"Process .I fileas input, and include all the resulting output,before processing the regular input file.  .TP.B \-lang-c.TP.B \-lang-c++.TP.B \-lang-objc.TP.B \-lang-objc++Specify the source language.  `\|\c.B \-lang-c++\c\&\|' makes the preprocessorhandle C++ comment syntax, and includes extra default includedirectories for C++, and `\|\c.B \-lang-objc\c\&\|' enables the Objective C`\|\c.B #import\c\&\|' directive.  `\|\c.B \-lang-c\c\&\|' explicitly turns off both ofthese extensions, and `\|\c.B \-lang-objc++\c\&\|' enables both.These options are generated by the compiler driver \c.B gcc\c\&, but notpassed from the `\|\c.B gcc\c\&\|' command line..TP.B \-lintLook for commands to the program checker \c.B lint\c\& embedded incomments, and emit them preceded by `\|\c.B #pragma lint\c\&\|'.  For example,the comment `\|\c.B /* NOTREACHED */\c\&\|' becomes `\|\c.B #pragma lintNOTREACHED\c\&\|'.This option is available only when you call \c.B cpp\c\& directly;\c.B gcc\c\& will not pass it from its command line..TP.B \-$Forbid the use of `\|\c.B $\c\&\|' in identifiers.  This is required for ANSIconformance.  \c.B gcc\c\& automatically supplies this option to thepreprocessor if you specify `\|\c.B \-ansi\c\&\|', but \c.B gcc\c\& doesn'trecognize the `\|\c.B \-$\c\&\|' option itself\(em\&to use it without the othereffects of `\|\c.B \-ansi\c\&\|', you must call the preprocessor directly..SH "SEE ALSO".RB "`\|" Cpp "\|'"entry in.B info\c\&;.I The C Preprocessor\c, Richard M. Stallman..br.BR gcc "(" 1 ");".RB "`\|" Gcc "\|'"entry in .B info\c\&;.I Using and Porting GNU CC (for version 2.0)\c, Richard M. Stallman..SH COPYINGCopyright (c) 1991, 1992 Free Software Foundation, Inc..PPPermission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies..PPPermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that theentire resulting derived work is distributed under the terms of apermission notice identical to this one..PPPermission is granted to copy and distribute translations of thismanual into another language, under the above conditions for modifiedversions, except that this permission notice may be included intranslations approved by the Free Software Foundation instead of inthe original English.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -