?? invoke.texi
字號:
@itemize @bullet@itemAll @code{extern} declarations take effect globally even if theyare written inside of a function definition. This includes implicitdeclarations of functions.@itemThe newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}and @code{volatile} are not recognized. (You can still use thealternative keywords such as @code{__typeof__}, @code{__inline__}, andso on.)@itemComparisons between pointers and integers are always allowed.@itemInteger types @code{unsigned short} and @code{unsigned char} promoteto @code{unsigned int}.@itemOut-of-range floating point literals are not an error.@itemCertain constructs which ANSI regards as a single invalid preprocessingnumber, such as @samp{0xe-0xd}, are treated as expressions instead.@itemString ``constants'' are not necessarily constant; they are stored inwritable space, and identical looking constants are allocatedseparately. (This is the same as the effect of@samp{-fwritable-strings}.)@cindex @code{longjmp} and automatic variables@itemAll automatic variables not declared @code{register} are preserved by@code{longjmp}. Ordinarily, GNU C follows ANSI C: automatic variablesnot declared @code{volatile} may be clobbered.@item@kindex \x@kindex \a@cindex escape sequences, traditionalThe character escape sequences @samp{\x} and @samp{\a} evaluate as theliteral characters @samp{x} and @samp{a} respectively. Without@w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimalrepresentation of a character, and @samp{\a} produces a bell.@itemIn C++ programs, assignment to @code{this} is permitted with@samp{-traditional}. (The option @samp{-fthis-is-variable} also hasthis effect.)@end itemizeYou may wish to use @samp{-fno-builtin} as well as @samp{-traditional}if your program uses names that are normally GNU C builtin functions forother purposes of its own.You cannot use @samp{-traditional} if you include any header files thatrely on ANSI C features. Some vendors are starting to ship systems withANSI C header files and you cannot use @samp{-traditional} on suchsystems to compile files that include any system headers.The @samp{-traditional} option also enables the @samp{-traditional-cpp}option, which is described next.@item -traditional-cppAttempt to support some aspects of traditional C preprocessors.Specifically:@itemize @bullet@itemComments convert to nothing at all, rather than to a space. This allowstraditional token concatenation.@itemIn a preprocessing directive, the @samp{#} symbol must appear as the firstcharacter of a line.@itemMacro arguments are recognized within string constants in a macrodefinition (and their values are stringified, though without additionalquote marks, when they appear in such a context). The preprocessoralways considers a string constant to end at 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.)@end itemize@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}.You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}if your program uses names that are normally GNU C builtin functions forother purposes of its own.You cannot use @samp{-traditional} if you include any header files thatrely on ANSI C features. Some vendors are starting to ship systems withANSI C header files and you cannot use @samp{-traditional} on suchsystems to compile files that include any system headers.@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 most target systems, but there are a few exceptions.)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.This option is deprecated.@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.This option is deprecated.@item -ffor-scope@itemx -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 -fguiding-declsTreat a function declaration with the same type as a potential functiontemplate instantiation as though it declares that instantiation, not anormal function. If a definition is given for the function later in thetranslation unit (or another translation unit if the target supportsweak symbols), that definition will be used; otherwise the template willbe instantiated. This behavior reflects the C++ language prior toSeptember 1996, when guiding declarations were removed.This option implies @samp{-fname-mangling-version-0}, and will not workwith other name mangling versions.@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 software
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -