diff options
Diffstat (limited to 'contrib/gcc/doc/invoke.texi')
-rw-r--r-- | contrib/gcc/doc/invoke.texi | 129 |
1 files changed, 78 insertions, 51 deletions
diff --git a/contrib/gcc/doc/invoke.texi b/contrib/gcc/doc/invoke.texi index d69d896..a99440f 100644 --- a/contrib/gcc/doc/invoke.texi +++ b/contrib/gcc/doc/invoke.texi @@ -343,7 +343,7 @@ in the following sections. -mapp-regs -mbroken-saverestore -mcypress @gol -mfaster-structs -mflat @gol -mfpu -mhard-float -mhard-quad-float @gol --mimpure-text -mlive-g0 -mno-app-regs @gol +-mimpure-text -mlittle-endian -mlive-g0 -mno-app-regs @gol -mno-faster-structs -mno-flat -mno-fpu @gol -mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol -msoft-float -msoft-quad-float -msparclite -mstack-bias @gol @@ -1575,14 +1575,14 @@ Instantiations of these templates may be mangled incorrectly. @item -Wctor-dtor-privacy @r{(C++ only)} @opindex Wctor-dtor-privacy -Warn when a class seems unusable, because all the constructors or -destructors in a class are private and the class has no friends or +Warn when a class seems unusable because all the constructors or +destructors in that class are private, and it has neither friends nor public static member functions. This warning is enabled by default. @item -Wnon-virtual-dtor @r{(C++ only)} @opindex Wnon-virtual-dtor -Warn when a class declares a non-virtual destructor that should probably -be virtual, because it looks like the class will be used polymorphically. +Warn when a class appears to be polymorphic, thereby requiring a virtual +destructor, yet it declares a non-virtual one. This warning is enabled by @option{-Wall}. @item -Wreorder @r{(C++ only)} @@ -1600,9 +1600,9 @@ struct A @{ @}; @end smallexample -Here the compiler will warn that the member initializers for @samp{i} -and @samp{j} will be rearranged to match the declaration order of the -members. This warning is enabled by @option{-Wall}. +The compiler will rearrange the member initializers for @samp{i} +and @samp{j} to match the declaration order of the members, emitting +a warning to that effect. This warning is enabled by @option{-Wall}. @end table The following @option{-W@dots{}} options are not affected by @option{-Wall}. @@ -1632,8 +1632,8 @@ Item 23: Don't try to return a reference when you must return an object. @end itemize -and about violations of the following style guidelines from Scott Meyers' -@cite{More Effective C++} book: +Also warn about violations of the following style guidelines from +Scott Meyers' @cite{More Effective C++} book: @itemize @bullet @item @@ -1645,8 +1645,8 @@ Item 7: Never overload @code{&&}, @code{||}, or @code{,}. @end itemize -If you use this option, you should be aware that the standard library -headers do not obey all of these guidelines; you can use @samp{grep -v} +When selecting this option, be aware that the standard library +headers do not obey all of these guidelines; use @samp{grep -v} to filter out those warnings. @item -Wno-deprecated @r{(C++ only)} @@ -1656,7 +1656,7 @@ Do not warn about usage of deprecated features. @xref{Deprecated Features}. @item -Wno-non-template-friend @r{(C++ only)} @opindex Wno-non-template-friend Disable warnings when non-templatized friend functions are declared -within a template. With the advent of explicit template specification +within a template. Since the advent of explicit template specification support in G++, if the name of the friend is an unqualified-id (i.e., @samp{friend foo(int)}), the C++ language specification demands that the friend declare or define an ordinary, nontemplate function. (Section @@ -1664,7 +1664,7 @@ friend declare or define an ordinary, nontemplate function. (Section could be interpreted as a particular specialization of a templatized function. Because this non-conforming behavior is no longer the default behavior for G++, @option{-Wnon-template-friend} allows the compiler to -check existing code for potential trouble spots, and is on by default. +check existing code for potential trouble spots and is on by default. This new compiler behavior can be turned off with @option{-Wno-non-template-friend} which keeps the conformant compiler code but disables the helpful warning. @@ -1674,7 +1674,7 @@ but disables the helpful warning. Warn if an old-style (C-style) cast to a non-void type is used within a C++ program. The new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are less vulnerable to -unintended effects, and much easier to grep for. +unintended effects and much easier to search for. @item -Woverloaded-virtual @r{(C++ only)} @opindex Woverloaded-virtual @@ -1694,7 +1694,7 @@ struct B: public A @{ @end smallexample the @code{A} class version of @code{f} is hidden in @code{B}, and code -like this: +like: @smallexample B* b; @@ -1711,7 +1711,7 @@ to a plain pointer. @item -Wsign-promo @r{(C++ only)} @opindex Wsign-promo Warn when overload resolution chooses a promotion from unsigned or -enumeral type to a signed type over a conversion to an unsigned type of +enumeral type to a signed type, over a conversion to an unsigned type of the same size. Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior. @@ -1746,7 +1746,7 @@ In this example, G++ will synthesize a default @samp{A& operator = @cindex Objective-C options, command line @cindex options, Objective-C This section describes the command-line options that are only meaningful -for Objective-C programs; but you can also use most of the GNU compiler +for Objective-C programs, but you can also use most of the GNU compiler options regardless of what language your program is in. For example, you might compile a file @code{some_class.m} like this: @@ -1755,7 +1755,7 @@ gcc -g -fgnu-runtime -O -c some_class.m @end example @noindent -In this example, only @option{-fgnu-runtime} is an option meant only for +In this example, @option{-fgnu-runtime} is an option meant only for Objective-C programs; you can use the other options with any language supported by GCC@. @@ -1801,8 +1801,8 @@ and no warning is issued for them. Warn if multiple methods of different types for the same selector are found during compilation. The check is performed on the list of methods in the final stage of compilation. Additionally, a check is performed -that for each selector appearing in a @code{@@selector(@dots{})} -expression, a corresponding method with that selector has been found +for each selector appearing in a @code{@@selector(@dots{})} +expression, and a corresponding method for that selector has been found during compilation. Because these checks scan the method table only at the end of compilation, these warnings are not produced if the final stage of compilation is not reached, for example because an error is @@ -1813,13 +1813,13 @@ being used. @opindex Wundeclared-selector Warn if a @code{@@selector(@dots{})} expression referring to an undeclared selector is found. A selector is considered undeclared if no -method with that name has been declared (explicitly, in an -@code{@@interface} or @code{@@protocol} declaration, or implicitly, in -an @code{@@implementation} section) before the -@code{@@selector(@dots{})} expression. This option always performs its -checks as soon as a @code{@@selector(@dots{})} expression is found -(while @code{-Wselector} only performs its checks in the final stage of -compilation), and so additionally enforces the coding style convention +method with that name has been declared before the +@code{@@selector(@dots{})} expression, either explicitly in an +@code{@@interface} or @code{@@protocol} declaration, or implicitly in +an @code{@@implementation} section. This option always performs its +checks as soon as a @code{@@selector(@dots{})} expression is found, +while @code{-Wselector} only performs its checks in the final stage of +compilation. This also enforces the coding style convention that methods and selectors must be declared before being used. @c not documented because only avail via -Wp @@ -2386,7 +2386,7 @@ For example, an expression such as @samp{x[i,j]} will cause a warning, but @samp{x[(void)i,j]} will not. @item -An unsigned value is compared against zero with @samp{<} or @samp{<=}. +An unsigned value is compared against zero with @samp{<} or @samp{>=}. @item A comparison like @samp{x<=y<=z} appears; this is equivalent to @@ -3447,7 +3447,7 @@ optimizations designed to reduce code size. @option{-Os} disables the following optimization flags: @gccoptlist{-falign-functions -falign-jumps -falign-loops @gol --falign-labels -freorder-blocks -fprefetch-loop-arrays} +-falign-labels -freorder-blocks -fprefetch-loop-arrays} If you use multiple @option{-O} options, with or without level numbers, the last such option is the one that is effective. @@ -3559,7 +3559,7 @@ specified individually by using @option{--param @var{name}=@var{value}}. The @option{-finline-limit=@var{n}} option sets some of these parameters as follows: - @table @gcctabopt +@table @gcctabopt @item max-inline-insns is set to @var{n}. @item max-inline-insns-single @@ -3570,7 +3570,7 @@ as follows: is set to 130 or @var{n}/4, whichever is smaller. @item max-inline-insns-rtl is set to @var{n}. - @end table +@end table Using @option{-finline-limit=600} thus results in the default settings for these parameters. See below for a documentation of the individual @@ -4259,7 +4259,6 @@ using the ELF object format and SPARC processors running Solaris 2 have linkers with such optimizations. AIX may have these optimizations in the future. - Only use these options when there are significant benefits from doing so. When you specify these options, the assembler and linker will create larger object and executable files and will also be slower. @@ -5016,7 +5015,7 @@ for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} wa simply substituted with a file name chosen for the previous @samp{%u}, without regard to any appended suffix. -@item %j@var{SUFFIX} +@item %j@var{suffix} Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is writable, and if save-temps is off; otherwise, substitute the name of a temporary file, just like @samp{%u}. This temporary file is not @@ -5780,6 +5779,22 @@ ABI@. Thus, it's intended only for use on targets where the developer acknowledges that their resulting code will not be directly in line with the rules of the ABI@. +@item -mimpure-text +@opindex mimpure-text +@option{-mimpure-text}, used in addition to @option{-shared}, tells +the compiler to not pass @option{-z text} to the linker when linking a +shared object. Using this option, you can link position-dependent +code into a shared object. + +@option{-mimpure-text} suppresses the ``relocations remain against +allocatable but non-writable sections'' linker error message. +However, the necessary relocations will trigger copy-on-write, and the +shared object is not actually shared across processes. Instead of +using @option{-mimpure-text}, you should compile all source code with +@option{-fpic} or @option{-fPIC}. + +This option is only available on SunOS and Solaris. + @item -mv8 @itemx -msparclite @opindex mv8 @@ -5888,7 +5903,8 @@ on SPARC V9 processors in 64-bit environments. @table @gcctabopt @item -mlittle-endian @opindex mlittle-endian -Generate code for a processor running in little-endian mode. +Generate code for a processor running in little-endian mode. It is only +available for a few configurations and most notably not on Solaris. @item -m32 @itemx -m64 @@ -7222,7 +7238,7 @@ This option sets flags for both the preprocessor and linker. @cindex Darwin options These options are defined for all architectures running the Darwin operating -system. These are useful for compatibility with other Mac OS compilers. +system. They are useful for compatibility with other Mac OS compilers. @table @gcctabopt @item -all_load @@ -7961,22 +7977,33 @@ the published application binary interface specifications for the 386 and will not be binary compatible with structures in code compiled without that switch. +@item -m96bit-long-double @item -m128bit-long-double +@opindex m96bit-long-double @opindex m128bit-long-double -Control the size of @code{long double} type. i386 application binary interface -specify the size to be 12 bytes, while modern architectures (Pentium and newer) -prefer @code{long double} aligned to 8 or 16 byte boundary. This is -impossible to reach with 12 byte long doubles in the array accesses. +These switches control the size of @code{long double} type. The i386 +application binary interface specifies the size to be 96 bits, +so @option{-m96bit-long-double} is the default in 32 bit mode. + +Modern architectures (Pentium and newer) would prefer @code{long double} +to be aligned to an 8 or 16 byte boundary. In arrays or structures +conforming to the ABI, this would not be possible. So specifying a +@option{-m128bit-long-double} will align @code{long double} +to a 16 byte boundary by padding the @code{long double} with an additional +32 bit zero. + +In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as +its ABI specifies that @code{long double} is to be aligned on 16 byte boundary. + +Notice that neither of these options enable any extra precision over the x87 +standard of 80 bits for a @code{long double}. -@strong{Warning:} if you use the @option{-m128bit-long-double} switch, the +@strong{Warning:} if you override the default value for your target ABI, the structures and arrays containing @code{long double} will change their size as well as function calling convention for function taking @code{long double} -will be modified. +will be modified. Hence they will not be binary compatible with arrays or +structures in code compiled without that switch. -@item -m96bit-long-double -@opindex m96bit-long-double -Set the size of @code{long double} to 96 bits as required by the i386 -application binary interface. This is the default. @item -msvr3-shlib @itemx -mno-svr3-shlib @@ -9156,11 +9183,11 @@ option is on by default if you optimize. @itemx -mprolog-function @opindex mno-prolog-function @opindex mprolog-function -Do not use (do use) external functions to save and restore registers at -the prolog and epilog of a function. The external functions are slower, -but use less code space if more than one function saves the same number -of registers. The @option{-mprolog-function} option is on by default if -you optimize. +Do not use (do use) external functions to save and restore registers +at the prologue and epilogue of a function. The external functions +are slower, but use less code space if more than one function saves +the same number of registers. The @option{-mprolog-function} option +is on by default if you optimize. @item -mspace @opindex mspace |