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

📄 invoke.texi

📁 gcc库的原代码,对编程有很大帮助.
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@itemIn the preprocessor, comments convert to nothing at all, rather thanto a space.  This allows traditional token concatenation.@itemIn preprocessing directive, the @samp{#} symbol must appear as the firstcharacter of a line.@itemIn the preprocessor, macro arguments are recognized within stringconstants in a macro definition (and their values are stringified,though without additional quote marks, when they appear in such acontext).  The preprocessor always considers a string constant to endat a newline.@item@cindex detecting @w{@samp{-traditional}}The predefined macro @code{__STDC__} is not defined when you use@samp{-traditional}, but @code{__GNUC__} is (since the GNU extensionswhich @code{__GNUC__} indicates are not affected by@samp{-traditional}).  If you need to write header files that workdifferently depending on whether @samp{-traditional} is in use, bytesting both of these predefined macros you can distinguish foursituations: GNU C, traditional GNU C, other ANSI C compilers, and otherold C compilers.  The predefined macro @code{__STDC_VERSION__} is alsonot defined when you use @samp{-traditional}.  @xref{StandardPredefined,,Standard Predefined Macros,cpp.info,The C Preprocessor},for more discussion of these and other predefined macros.@item@cindex string constants vs newline@cindex newline vs string constantsThe preprocessor considers a string constant to end at a newline (unlessthe newline is escaped with @samp{\}).  (Without @w{@samp{-traditional}},string constants can contain the newline character as typed.)@item -traditional-cppAttempt to support some aspects of traditional C preprocessors.This includes the last five items in the table immediately above,but none of the other effects of @samp{-traditional}.@item -fcond-mismatchAllow conditional expressions with mismatched types in the second andthird arguments.  The value of such an expression is void.@item -funsigned-charLet the type @code{char} be unsigned, like @code{unsigned char}.Each kind of machine has a default for what @code{char} shouldbe.  It is either like @code{unsigned char} by default or like@code{signed char} by default.Ideally, a portable program should always use @code{signed char} or@code{unsigned char} when it depends on the signedness of an object.But many programs have been written to use plain @code{char} 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 @code{char} is always a distinct type from each of@code{signed char} or @code{unsigned char}, even though its behavioris always just like one of those two.@item -fsigned-charLet the type @code{char} be signed, like @code{signed char}.Note that this is equivalent to @samp{-fno-unsigned-char}, which isthe negative form of @samp{-funsigned-char}.  Likewise, the option@samp{-fno-signed-char} is equivalent to @samp{-funsigned-char}.@item -fsigned-bitfields@itemx -funsigned-bitfields@itemx -fno-signed-bitfields@itemx -fno-unsigned-bitfieldsThese options control whether a bitfield is signed or unsigned, when thedeclaration does not use either @code{signed} or @code{unsigned}.  Bydefault, such a bitfield is signed, because this is consistent: thebasic integer types such as @code{int} are signed types.However, when @samp{-traditional} is used, bitfields are all unsignedno matter what.@item -fwritable-stringsStore string constants in the writable data segment and don't uniquizethem.  This is for compatibility with old programs which assume they canwrite into string constants.  The option @samp{-traditional} also hasthis effect.Writing into string constants is a very bad idea; ``constants'' shouldbe constant.@item -fallow-single-precisionDo not promote single precision math operations to double precision,even when compiling with @samp{-traditional}.Traditional K&R C promotes all floating point operations to doubleprecision, regardless of the sizes of the operands.   On thearchitecture for which you are compiling, single precision may be fasterthan double precision.   If you must use @samp{-traditional}, but wantto use single precision operations when the operands are singleprecision, use this option.   This option has no effect when compilingwith ANSI or GNU C conventions (the default).@end table@node C++ Dialect Options@section Options Controlling C++ Dialect@cindex compiler options, C++@cindex C++ options, command line@cindex options, C++This section describes the command-line options that are only meaningfulfor C++ programs; but you can also use most of the GNU compiler optionsregardless of what language your program is in.  For example, youmight compile a file @code{firstClass.C} like this:@exampleg++ -g -felide-constructors -O -c firstClass.C@end example@noindentIn this example, only @samp{-felide-constructors} is an option meantonly for C++ programs; you can use the other options with anylanguage supported by GNU CC.Here is a list of options that are @emph{only} for compiling C++ programs:@table @code@item -fno-access-controlTurn off all access checking.  This switch is mainly useful for workingaround bugs in the access control code.@item -fall-virtualTreat all possible member functions as virtual, implicitly.All member functions (except for constructor functions and @code{new} or@code{delete} member operators) are treated as virtual functions of theclass where they appear.This does not mean that all calls to these member functions will be madethrough the internal table of virtual functions.  Under somecircumstances, the compiler can determine that a call to a given virtualfunction can be made directly; in these cases the calls are direct inany case.@item -fcheck-newCheck that the pointer returned by @code{operator new} is non-nullbefore attempting to modify the storage allocated.  The current WorkingPaper requires that @code{operator new} never return a null pointer, sothis check is normally unnecessary.@item -fconserve-spacePut uninitialized or runtime-initialized global variables into thecommon segment, as C does.  This saves space in the executable at thecost of not diagnosing duplicate definitions.  If you compile with thisflag and your program mysteriously crashes after @code{main()} hascompleted, you may have an object that is being destroyed twice becausetwo definitions were merged.@item -fdollars-in-identifiersAccept @samp{$} in identifiers.  You can also explicitly prohibit use of@samp{$} with the option @samp{-fno-dollars-in-identifiers}.  (GNU C++allows @samp{$} by default on some target systems but not others.)Traditional C allowed the character @samp{$} to form part ofidentifiers.  However, ANSI C and C++ forbid @samp{$} in identifiers.@item -fenum-int-equivAnachronistically permit implicit conversion of @code{int} toenumeration types.  Current C++ allows conversion of @code{enum} to@code{int}, but not the other way around.@item -fexternal-templatesCause template instantiations to obey @samp{#pragma interface} and@samp{implementation}; template instances are emitted or not accordingto the location of the template definition.  @xref{TemplateInstantiation}, for more information.@item -falt-external-templatesSimilar to -fexternal-templates, but template instances are emitted ornot according to the place where they are first instantiated.@xref{Template Instantiation}, for more information.@item -ffor-scope@item -fno-for-scopeIf -ffor-scope is specified, the scope of variables declared ina @i{for-init-statement} is limited to the @samp{for} loop itself,as specified by the draft C++ standard.If -fno-for-scope is specified, the scope of variables declared ina @i{for-init-statement} extends to the end of the enclosing scope,as was the case in old versions of gcc, and other (traditional)implementations of C++.The default if neither flag is given to follow the standard,but to allow and give a warning for old-style code that wouldotherwise be invalid, or have different behavior.@item -fno-gnu-keywordsDo not recognize @code{classof}, @code{headof}, @code{signature},@code{sigof} or @code{typeof} as a keyword, so that code can use thesewords as identifiers.  You can use the keywords @code{__classof__},@code{__headof__}, @code{__signature__}, @code{__sigof__}, and@code{__typeof__} instead.  @samp{-ansi} implies@samp{-fno-gnu-keywords}.@item -fno-implicit-templatesNever emit code for templates which are instantiated implicitly (i.e. byuse); only emit code for explicit instantiations.  @xref{TemplateInstantiation}, for more information.@item -fhandle-signaturesRecognize the @code{signature} and @code{sigof} keywords for specifyingabstract types.  The default (@samp{-fno-handle-signatures}) is not torecognize them.  @xref{C++ Signatures, Type Abstraction usingSignatures}.@item -fhuge-objectsSupport virtual function calls for objects that exceed the sizerepresentable by a @samp{short int}.  Users should not use this flag bydefault; if you need to use it, the compiler will tell you so.  If youcompile any of your code with this flag, you must compile @emph{all} ofyour code with this flag (including libg++, if you use it).This flag is not useful when compiling with -fvtable-thunks.@item -fno-implement-inlinesTo save space, do not emit out-of-line copies of inline functionscontrolled by @samp{#pragma implementation}.  This will cause linkererrors if these functions are not inlined everywhere they are called.@item -fmemoize-lookups@itemx -fsave-memoizedUse heuristics to compile faster.  These heuristics are not enabled bydefault, since they are only effective for certain input files.  Otherinput files compile more slowly.The first time the compiler must build a call to a member function (orreference to a data member), it must (1) determine whether the classimplements member functions of that name; (2) resolve which memberfunction to call (which involves figuring out what sorts of typeconversions need to be made); and (3) check the visibility of the memberfunction to the caller.  All of this adds up to slower compilation.Normally, the second time a call is made to that member function (orreference to that data member), it must go through the same lengthyprocess again.  This means that code like this:@smallexamplecout << "This " << p << " has " << n << " legs.\n";@end smallexample@noindentmakes six passes through all three steps.  By using a software cache, a``hit'' significantly reduces this cost.  Unfortunately, using the cacheintroduces another layer of mechanisms which must be implemented, and soincurs its own overhead.  @samp{-fmemoize-lookups} enables the softwarecache.Because access privileges (visibility) to members and member functionsmay differ from one function context to the next, G++ may need to flushthe cache.  With the @samp{-fmemoize-lookups} flag, the cache is flushedafter every function that is compiled.  The @samp{-fsave-memoized} flagenables the same software cache, but when the compiler determines thatthe context of the last function compiled would yield the same accessprivileges of the next function to compile, it preserves the cache.This is most helpful when defining many member functions for the sameclass: with the exception of member functions which are friends of otherclasses, each member function has exactly the same access privileges asevery other, and the cache need not be flushed.The code that implements these flags has rotted; you should probablyavoid using them.@item -fstrict-prototypeWithin an @samp{extern "C"} linkage specification, treat a functiondeclaration with no arguments, such as @samp{int foo ();}, as declaringthe function to take no arguments.  Normally, such a declaration meansthat the function @code{foo} can take any combination of arguments, asin C.  @samp{-pedantic} implies @samp{-fstrict-prototype} unlessoverridden with @samp{-fno-strict-prototype}.This flag no longer affects declarations with C++ linkage.@item -fno-nonnull-objectsDon't assume that a reference is initialized to refer to a valid object.Although the current C++ Working Paper prohibits null references, someold code may rely on them, and you can use @samp{-fno-nonnull-objects}to turn on checking.At the moment, the compiler only does this checking for conversions tovirtual base classes.@item -foperator-namesRecognize the operator name keywords @code{and}, @code{bitand},@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} assynonyms for the symbols they refer to.  @samp{-ansi} implies@samp{-foperator-names}.@item -fthis-is-variablePermit assignment to @code{this}.  The incorporation of user-definedfree store management into C++ has made assignment to @samp{this} ananachronism.  Therefore, by default it is invalid to assign to@code{this} within a class member function; that is, GNU C++ treats@samp{this} in a member function of class @code{X} as a non-lvalue oftype @samp{X *}.  However, for backwards compatibility, you can make itvalid with @samp{-fthis-is-variable}.@item -fvtable-thunksUse @samp{thunks} to implement the virtual function dispatch table(@samp{vtable}).  The traditional (cfront-style) approach toimplementing vtables was to store a pointer to the function and twooffsets for adjusting the @samp{this} pointer at the call site.  Newerimplementations store a single pointer to a @samp{thunk} function whichdoes any necessary adjustment and then calls the target function.This option also enables a heuristic for controlling emission ofvtables; if a class has any non-inline virtual functions, the vtablewill be emitted in the translation unit containing the first one ofthose.@item -nostdinc++Do not search for header files in the standard directories specific toC++, but do still search the other standard directories.  (This optionis used when building libg++.)@item -traditionalFor C++ programs (in addition to the effects that apply to both C andC++), this has the same effect as @samp{-fthis-is-variable}.@xref{C Dialect Options,, Options Controlling C Dialect}.@end tableIn addition, these optimization, warning, and code generation optionshave meanings only for C++ programs:@table @code@item -fno-default-inlineDo not assume @samp{inline} for functions defined inside a class scope.@xref{Optimize Options,,Options That Control Optimization}.@item -Wenum-clash@itemx -Woverloaded-virtual@itemx -Wtemplate-debuggingWarnings that apply only to C++ programs.  @xref{WarningOptions,,Options to Request or Suppress Warnings}.@item +e@var{n}

⌨️ 快捷键说明

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