📄 gcc.1
字号:
\&.o\c\&\|', its assembler file in `\|\c.B \c.I source\c\&.s\c\&\|', andall preprocessed C source on the standard output..TP.B \-vPrint (on the standard error output) the commands executed to run the stagesof compilation. Also print the version number of the compiler driverprogram and of the preprocessor and the compiler proper..TP.B \-pipeUse pipes rather than temporary files for communication between thevarious stages of compilation. This fails to work on some systems wherethe assembler cannot read from a pipe; but the GNU assembler hasno trouble..PP.SH LANGUAGE OPTIONSThe following options control the dialect of C that the compileraccepts:.TP.B \-ansi.ISupport all ANSI standard C programs. .IThis turns off certain features of GNU C that are incompatible withANSI C, such as the \c.B asm\c\&, \c.B inline\c\& and \c.B typeof\c\&keywords, and predefined macros such as \c.B unix\c\& and \c.B vax\c\&that identify the type of system you are using. It also enables theundesirable and rarely used ANSI trigraph feature, and makes thepreprocessor accept `\|\c.B $\c\&\|' as part of identifiers.The alternate keywords \c.B __asm__\c\&, \c.B __extension__\c\&,\c.B __inline__\c\& and \c.B __typeof__\c\& continue to work despite`\|\c.B \-ansi\c\&\|'. You would not want to use them in an ANSI C program, ofcourse, but it is useful to put them in header files that might be includedin compilations done with `\|\c.B \-ansi\c\&\|'. Alternate predefined macrossuch as \c.B __unix__\c\& and \c.B __vax__\c\& are also available, with orwithout `\|\c.B \-ansi\c\&\|'.The `\|\c.B \-ansi\c\&\|' option does not cause non-ANSI programs to berejected gratuitously. For that, `\|\c.B \-pedantic\c\&\|' is required inaddition to `\|\c.B \-ansi\c\&\|'. The preprocessor predefines a macro \c.B __STRICT_ANSI__\c\& when you use the `\|\c.B \-ansi\c\&\|'option. Some header files may notice this macro and refrainfrom declaring certain functions or defining certain macros that theANSI standard doesn't call for; this is to avoid interfering with anyprograms that might use these names for other things..TP.B \-fno\-asmDo not recognize \c.B asm\c\&, \c.B inline\c\& or \c.B typeof\c\& as akeyword. These words may then be used as identifiers. You canuse \c.B __asm__\c\&, \c.B __inline__\c\& and \c.B __typeof__\c\& instead.`\|\c.B \-ansi\c\&\|' implies `\|\c.B \-fno\-asm\c\&\|'..TP.B \-fno\-builtin.I (Ignored for C++.)Don't recognize non-ANSI built-in functions. `\|\c.B \-ansi\c\&\|' also has thiseffect. Currently, the only function affected is .B alloca\c\&..TP.B \-fno\-strict\-prototype.I(C++ only.)Consider the declaration \c.B int foo ();\c\&. In C++, this means that thefunction \c.B foo\c\& takes no arguments. In ANSI C, this is declared.B int foo(void);\c\&. With the flag `\|\c.B \-fno\-strict\-prototype\c\&\|',declaring functions with no arguments is equivalent to declaring itsargument list to be untyped, i.e., \c.B int foo ();\c\& is equivalent tosaying \c.B int foo (...);\c\&..TP.B \-trigraphsSupport ANSI C trigraphs. The `\|\c.B \-ansi\c\&\|' option implies `\|\c.B \-trigraphs\c\&\|'..TP.B \-traditionalAttempt to support some aspects of traditional C compilers.For details, see the GNU C Manual; the duplicate list herehas been deleted so that we won't get complaints when itis out of date.But one note about C++ programs only (not C). `\|\c.B \-traditional\c\&\|' has one additional effect for C++: assignment to .B thisis permitted. This is the same as the effect of `\|\c.B \-fthis\-is\-variable\c\&\|'..TP.B \-traditional\-cppAttempt to support some aspects of traditional C preprocessors.This includes the items that specifically mention the preprocessor above,but none of the other effects of `\|\c.B \-traditional\c\&\|'..TP.B \-fdollars\-in\-identifiers.I(C++ only.)Permit the use of `\|\c.B $\c\&\|' in identifiers. (For GNU C, this is the default, and you canforbid it with `\|\c.B \-ansi\c\&\|'.)Traditional C allowed the character `\|\c.B $\c\&\|' to form part of identifiers; by default, GNU C alsoallows this. However, ANSI C forbids `\|\c.B $\c\&\|' in identifiers, and GNU C++ also forbids it by default on mostplatforms (though on some platforms it's enabled by default for GNUC++ as well)..TP.B \-fenum\-int\-equiv.I(C++ only.)Normally GNU C++ allows conversion of .B enumto.B int\c\&, but not the other way around. Use this option if you want GNU C++to allow conversion of.B intto .B enumas well. .TP.B \-fall\-virtual.I(C++ only.)When you use the `\|\c.B \-fall\-virtual\c\&\|', all member functions(except for constructor functions and new/delete member operators)declared in the same class with a ``method-call'' operator method aretreated as virtual functions of the given class. In effect, allof these methods become ``implicitly virtual.''This does \c.I not\c\& mean that all calls to these methods will be made through theinternal table of virtual functions. There are some circumstancesunder which it is obvious that a call to a given virtual function canbe made directly, and in these cases the calls still go direct.The effect of making all methods of a class with a declared\&`\|\c.Boperator->()()\c\&\|' implicitly virtual using `\|\c.B \-fall\-virtual\c\&\|' extendsalso to all non-constructor methods of any class derived from such aclass..TP.B \-fcond\-mismatchAllow conditional expressions with mismatched types in the second andthird arguments. The value of such an expression is void..TP.B \-fthis\-is\-variable.I(C++ only.)The incorporation of user-defined free store management into C++ hasmade assignment to \c.B this\c\& an anachronism. Therefore, by default GNUC++ treats the type of \c.B this\c\& in a member function of \c.B class X\c\&to be \c.B X *const\c\&. In other words, it is illegal to assign to\c.B this\c\& within a class member function. However, for backwardscompatibility, you can invoke the old behavior by using\&`\|\c.B \-fthis\-is\-variable\c\&\|'..TP.B \-funsigned\-charLet the type \c.B char\c\& be unsigned, like \c.B unsigned char\c\&.Each kind of machine has a default for what \c.B char\c\& shouldbe. It is either like \c.B unsigned char\c\& by default or like\c.B signed char\c\& by default.Ideally, a portable program should always use \c.B signed char\c\& or\c.B unsigned char\c\& when it depends on the signedness of an object.But many programs have been written to use plain \c.B char\c\& andexpect it to be signed, or expect it to be unsigned, depending on themachines they were written for. This option, and its inverse, let youmake such a program work with the opposite default.The type \c.B char\c\& is always a distinct type from each of\c.B signed char\c\& and \c.B unsigned char\c\&, even though its behavioris always just like one of those two..TP.B \-fsigned\-charLet the type \c.B char\c\& be signed, like \c.B signed char\c\&.Note that this is equivalent to `\|\c.B \-fno\-unsigned\-char\c\&\|', which isthe negative form of `\|\c.B \-funsigned\-char\c\&\|'. Likewise,`\|\c.B \-fno\-signed\-char\c\&\|' is equivalent to `\|\c.B \-funsigned\-char\c\&\|'..TP.B \-fsigned\-bitfields.TP.B \-funsigned\-bitfields.TP.B \-fno\-signed\-bitfields.TP.B \-fno\-unsigned\-bitfieldsThese options control whether a bitfield issigned or unsigned, when declared with no explicit `\|\c.B signed\c\&\|' or `\|\c.B unsigned\c\&\|' qualifier. By default, such a bitfield issigned, because this is consistent: the basic integer types such as\c.B int\c\& are signed types.However, when you specify `\|\c.B \-traditional\c\&\|', bitfields are all unsignedno matter what..TP.B \-fwritable\-stringsStore string constants in the writable data segment and don't uniquizethem. This is for compatibility with old programs which assume theycan write into string constants. `\|\c.B \-traditional\c\&\|' also has thiseffect.Writing into string constants is a very bad idea; ``constants'' shouldbe constant..PP.SH PREPROCESSOR OPTIONSThese options control the C preprocessor, which is run on each C sourcefile before actual compilation.If you use the `\|\c.B \-E\c\&\|' option, GCC does nothing except preprocessing.Some of these options make sense only together with `\|\c.B \-E\c\&\|' becausethey cause the preprocessor output to be unsuitable for actualcompilation..TP.BI "\-i " 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 \-i \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 \-i\c\&\|' \c.I file\c\&..TP.B \-nostdincDo not search the standard system directories for header files. Onlythe directories you have specified with `\|\c.B \-I\c\&\|' options (and thecurrent directory, if appropriate) are searched. By using both `\|\c.B \-nostdinc\c\&\|' and `\|\c.B \-I\-\c\&\|', you can limit the include-file search file to only thosedirectories you specify explicitly..TP.B \-undefDo not predefine any nonstandard macros. (Including architecture flags)..TP.B \-ERun only the C preprocessor. Preprocess all the C source filesspecified and output the results to the standard output or to thespecified output file..TP.B \-CTell the preprocessor not to discard comments. Used with the`\|\c.B \-E\c\&\|' option..TP.B \-PTell the preprocessor not to generate `\|\c.B #line\c\&\|' commands.Used with the `\|\c.B \-E\c\&\|' option..TP.B \-MTell the preprocessor to output a rule suitable for \c.B make\c\&describing the dependencies of each object file. For each source file,the preprocessor outputs one \c.B make\c\&-rule whose target is the objectfile name for that source file and whose dependencies are all the files`\|\c.B #include\c\&\|'d in it. This rule may be a single line or may becontinued with `\|\c.B \e\c\&\|newline if it is long. The list of rules isprinted on the standard output instead of the preprocessed C program.`\|\c.B \-M\c\&\|' implies `\|\c.B \-E\c\&\|'..TP.B \-MMLike `\|\c.B \-M\c\&\|' but the output mentions only the user header filesincluded with `\|\c.B #include "\c.I file\c\&"\c\&\|'. System header filesincluded 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.The Mach utility `\|\c.B md\c\&\|' can be used 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 \-D macroDefine macro \c.I macro\c\& with the string `\|\c.B 1\c\&\|' as its definition..TP.BI \-D macro = defnDefine macro \c.I macro\c\& as \c.I defn\c\&. All instances of `\|\c.B \-D\c\&\|' onthe command line are processed before any `\|\c.B \-U\c\&\|' or `\|\c.B \-i\c\&\|' options..TP.BI \-U macroUndefine macro \c.I macro\c\&. `\|\c.B \-U\c\&\|' options are evaluated after all `\|\c.B \-D\c\&\|' options, but before any `\|\c.B \-i\c\&\|' options..TP.B \-dMTell the preprocessor to output only a list of the macro definitionsthat are in effect at the end of preprocessing. Used with the `\|\c.B \-E\c\&\|'option..TP.B \-dDTell the preprocessing to pass all macro definitions into the output, intheir proper sequence in the rest of the output..TP.B \-dNLike `\|\c.B \-dD\c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -