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

📄 invoke.texi

📁 gcc-fortran,linux使用fortran的编译软件。很好用的。
💻 TEXI
📖 第 1 页 / 共 2 页
字号:
@item -Wnonstd-intrinsicWarn if the user tries to use an intrinsic that does not belong to the standard the user has chosen via the -std option.@cindex -Wsurprising@cindex options, -Wsurprising@item -Wsurprising@cindex SuspiciousProduce a warning when ``suspicious'' code constructs are encountered.While technically legal these usually indicate that an error has been made.This currently produces a warning under the following circumstances:@itemize @bullet@itemAn INTEGER SELECT construct has a CASE that can never be matched as itslower value is greater than its upper value.@itemA LOGICAL SELECT construct has three CASE statements.@end itemize@cindex -Wunderflow@cindex options, -Wunderflow@item -Wunderflow@cindex UNDERFLOWProduce a warning when numerical constant expressions areencountered, which yield an UNDERFLOW during compilation.@cindex -Wunused-labels option@cindex options, -Wunused-labels@item -Wunused-labels@cindex unused labels@cindex labels, unusedWarn whenever a label is defined but never referenced.@cindex -Werror@cindex options, -Werror@item -WerrorTurns all warnings into errors.@cindex -W option@cindex options, -W@item -W@cindex extra warnings@cindex warnings, extraTurns on ``extra warnings'' and, if optimization is specifiedvia @option{-O}, the @option{-Wuninitialized} option.(This might change in future versions of @command{gfortran}@end table@xref{Warning Options,,Options to Request or Suppress Warnings,gcc,Using the GNU Compiler Collection (GCC)}, for information on moreoptions offered by the GBE shared by @command{gfortran}, @command{gcc} andother GNU compilers.Some of these have no effect when compiling programs written in Fortran.@node Debugging Options@section Options for Debugging Your Program or GNU Fortran@cindex options, debugging@cindex debugging information optionsGNU Fortran has various special options that are used for debuggingeither your program or @command{gfortran}@table @gcctabopt@cindex -fdump-parse-tree option@cindex option, -fdump-parse-tree@item -fdump-parse-treeOutput the internal parse tree before starting code generation.  Onlyreally useful for debugging gfortran itself.@end table@table @gcctabopt@cindex -ffpe-trap=@var{list} option@cindex option, -ffpe-trap=@var{list}@item -ffpe-trap=@var{list}Specify a list of IEEE exceptions when a Floating Point Exception(FPE) should be raised.  On most systems, this will result in a SIGFPEsignal being sent and the program being interrupted, producing a corefile useful for debugging.  @var{list} is a (possibly empty) comma-separatedlist of the following IEEE exceptions: @samp{invalid} (invalid floatingpoint operation, such as @code{sqrt(-1.0)}), @samp{zero} (division byzero), @samp{overflow} (overflow in a floating point operation),@samp{underflow} (underflow in a floating point operation),@samp{precision} (loss of precision during operation) and @samp{denormal}(operation produced a denormal denormal value).@end table@xref{Debugging Options,,Options for Debugging Your Program or GCC,gcc,Using the GNU Compiler Collection (GCC)}, for more information ondebugging options.@node Directory Options@section Options for Directory Search@cindex directory, options@cindex options, directory search@cindex search path@cindex INCLUDE directive@cindex directive, INCLUDEThese options affect how @command{gfortran} searchesfor files specified by the @code{INCLUDE} directive and where it searchesfor previously compiled modules.It also affects the search paths used by @command{cpp} when used to preprocessFortran source.@table @gcctabopt@cindex -Idir option@cindex options, -Idir@item -I@var{dir}@cindex directory, search paths for inclusion@cindex inclusion, directory search paths for@cindex search paths, for included files@cindex paths, search@cindex module search pathThese affect interpretation of the @code{INCLUDE} directive(as well as of the @code{#include} directive of the @command{cpp}preprocessor).Also note that the general behavior of @option{-I} and@code{INCLUDE} is pretty much the same as of @option{-I} with@code{#include} in the @command{cpp} preprocessor, with regard tolooking for @file{header.gcc} files and other such things.This path is also used to search for @samp{.mod} files when previouslycompiled modules are required by a @code{USE} statement.@xref{Directory Options,,Options for Directory Search,gcc,Using the GNU Compiler Collection (GCC)}, for information on the@option{-I} option.@cindex -Mdir option@cindex option, -Mdir@item -M@var{dir}@item -J@var{dir}This option specifies where to put @samp{.mod} files for compiled modules.It is also added to the list of directories to searched by an @code{USE}statement.The default is the current directory.@option{-J} is an alias for @option{-M} to avoid conflicts with existingGCC options.@end table@node Runtime Options@section Influencing runtime behavior@cindex runtime, optionsThese options affect the runtime behavior of @command{gfortran}.@table @gcctabopt@cindex -fconvert=@var{conversion} option@item -fconvert=@var{conversion}Specify the representation of data for unformatted files.  Validvalues for conversion are: @samp{native}, the default; @samp{swap},swap between big- and little-endian; @samp{big-endian}, use big-endianrepresentation for unformatted files; @samp{little-endian}, use little-endianrepresentation for unformatted files.@emph{This option has an effect only when used in the main program.The @code{CONVERT} specifier and the GFORTRAN_CONVERT_UNIT environmentvariable override the default specified by -fconvert.}@end table@node Code Gen Options@section Options for Code Generation Conventions@cindex code generation, conventions@cindex options, code generation@cindex run-time, optionsThese machine-independent options control the interface conventionsused in code generation.Most of them have both positive and negative forms; the negative formof @option{-ffoo} would be @option{-fno-foo}.  In the table below, onlyone of the forms is listed---the one which is not the default.  Youcan figure out the other form by either removing @option{no-} or addingit.@table @gcctabopt@cindex @option{-fno-automatic} option@cindex options, @option{-fno-automatic}@item -fno-automatic@cindex SAVE statement@cindex statements, SAVETreat each program unit as if the @code{SAVE} statement was specified forevery local variable and array referenced in it. Does not affect commonblocks. (Some Fortran compilers provide this option under the name@option{-static}.)@cindex @option{-ff2c} option@cindex options, @option{-ff2c}@item -ff2c@cindex calling convention@cindex @command{f2c} calling convention@cindex @command{g77} calling convention@cindex libf2c calling conventionGenerate code designed to be compatible with code generatedby @command{g77} and @command{f2c}.The calling conventions used by @command{g77} (originally implementedin @command{f2c}) require functions that return typedefault @code{REAL} to actually return the C type @code{double}, andfunctions that return type @code{COMPLEX} to return the values via anextra argument in the calling sequence that points to where tostore the return value.  Under the default GNU calling conventions, suchfunctions simply return their results as they would in GNUC -- default @code{REAL} functions return the C type @code{float}, and@code{COMPLEX} functions return the GNU C type @code{complex}.Additionally, this option implies the @option{-fsecond-underscore}option, unless @option{-fno-second-underscore} is explicitly requested.This does not affect the generation of code that interfaces withthe @command{libgfortran} library.@emph{Caution:} It is not a good idea to mix Fortran code compiledwith @code{-ff2c} with code compiled with the default @code{-fno-f2c}calling conventions as, calling @code{COMPLEX} or default @code{REAL}functions between program parts which were compiled with differentcalling conventions will break at execution time.@emph{Caution:} This will break code which passes intrinsic functionsof type default @code{REAL} or @code{COMPLEX} as actual arguments, asthe library implementations use the @command{-fno-f2c} calling conventions.@cindex @option{-fno-underscoring option}@cindex options, @option{-fno-underscoring}@item -fno-underscoring@cindex underscore@cindex symbol names, underscores@cindex transforming symbol names@cindex symbol names, transformingDo not transform names of entities specified in the Fortransource file by appending underscores to them.With @option{-funderscoring} in effect, @command{gfortran} appends oneunderscore to external names with no underscores.  This is done to ensurecompatibility with code produced by many UNIX Fortran compilers.@emph{Caution}: The default behavior of @command{gfortran} isincompatible with @command{f2c} and @command{g77}, please use the@option{-ff2c} option if you want object files compiled with@option{gfortran} to be compatible with object code created with thesetools.Use of @option{-fno-underscoring} is not recommended unless you areexperimenting with issues such as integration of (GNU) Fortran intoexisting system environments (vis-a-vis existing libraries, tools, andso on).For example, with @option{-funderscoring}, and assuming other defaults like@option{-fcase-lower} and that @samp{j()} and @samp{max_count()} areexternal functions while @samp{my_var} and @samp{lvar} are local variables,a statement like@smallexampleI = J() + MAX_COUNT (MY_VAR, LVAR)@end smallexample@noindentis implemented as something akin to:@smallexamplei = j_() + max_count__(&my_var__, &lvar);@end smallexampleWith @option{-fno-underscoring}, the same statement is implemented as:@smallexamplei = j() + max_count(&my_var, &lvar);@end smallexampleUse of @option{-fno-underscoring} allows direct specification ofuser-defined names while debugging and when interfacing @command{gfortran}code with other languages.Note that just because the names match does @emph{not} mean that theinterface implemented by @command{gfortran} for an external name matches theinterface implemented by some other language for that same name.That is, getting code produced by @command{gfortran} to link to code producedby some other compiler using this or any other method can be only asmall part of the overall solution---getting the code generated byboth compilers to agree on issues other than naming can requiresignificant effort, and, unlike naming disagreements, linkers normallycannot detect disagreements in these other areas.Also, note that with @option{-fno-underscoring}, the lack of appendedunderscores introduces the very real possibility that a user-definedexternal name will conflict with a name in a system library, whichcould make finding unresolved-reference bugs quite difficult in somecases---they might occur at program run time, and show up only asbuggy behavior at run time.In future versions of @command{gfortran} we hope to improve naming and linkingissues so that debugging always involves using the names as they appearin the source, even if the names as seen by the linker are mangled toprevent accidental linking between procedures with incompatibleinterfaces.@cindex @option{-fsecond-underscore option}@cindex options, @option{-fsecond-underscore}@item -fsecond-underscore@cindex underscore@cindex symbol names, underscores@cindex transforming symbol names@cindex symbol names, transforming@cindex @command{f2c} calling convention@cindex @command{g77} calling convention@cindex libf2c calling conventionBy default, @command{gfortran} appends an underscore to externalnames.  If this option is used @command{gfortran} appends twounderscores to names with underscores and one underscore to external nameswith no underscores.  (@command{gfortran} also appends two underscores tointernal names with underscores to avoid naming collisions with externalnames.This option has no effect if @option{-fno-underscoring} isin effect.  It is implied by the @option{-ff2c} option.Otherwise, with this option, an external name such as @samp{MAX_COUNT}is implemented as a reference to the link-time external symbol@samp{max_count__}, instead of @samp{max_count_}.  This is requiredfor compatibility with @command{g77} and @command{f2c}, and is impliedby use of the @option{-ff2c} option.@cindex -fbounds-check option@cindex -ffortran-bounds-check option@item -fbounds-check@cindex bounds checking@cindex range checking@cindex array bounds checking@cindex subscript checking@cindex checking subscriptsEnable generation of run-time checks for array subscriptsand against the declared minimum and maximum values.  It alsochecks array indices for assumed and deferredshape arrays against the actual allocated bounds.In the future this may also include other forms of checking, eg. checkingsubstring references.@cindex -fmax-stack-var-size option@item -fmax-stack-var-size=@var{n}This option specifies the size in bytes of the largest array that will be puton the stack.This option currently only affects local arrays declared with constantbounds, and may not apply to all character variables.Future versions of @command{gfortran} may improve this behavior.The default value for @var{n} is 32768.@cindex -fpackderived@item -fpackderived@cindex Structure packingThis option tells gfortran to pack derived type members as closely aspossible.  Code compiled with this option is likely to be incompatiblewith code compiled without this option, and may execute slower.@cindex -frepack-arrays option@item -frepack-arrays@cindex Repacking arraysIn some circumstances @command{gfortran} may pass assumed shape arraysections via a descriptor describing a discontiguous area of memory.This option adds code to the function prologue to repack the data intoa contiguous block at runtime.This should result in faster accesses to the array.  However it can introducesignificant overhead to the function call, especially  when the passed datais discontiguous.@cindex -fshort-enums@item -fshort-enumsThis option is provided for interoperability with C code that wascompiled with the @command{-fshort-enums} option.  It will make@command{gfortran} choose the smallest @code{INTEGER} kind a givenenumerator set will fit in, and give all its enumerators this kind.@end table@xref{Code Gen Options,,Options for Code Generation Conventions,gcc,Using the GNU Compiler Collection (GCC)}, for information on more optionsoffered by the GBEshared by @command{gfortran} @command{gcc} and other GNU compilers.@c man end@node Environment Variables@section Environment Variables Affecting GNU Fortran@cindex environment variables@c man begin ENVIRONMENTGNU Fortran 95 currently does not make use of any environmentvariables to control its operation above and beyond thosethat affect the operation of @command{gcc}.@xref{Environment Variables,,Environment Variables Affecting GCC,gcc,Using the GNU Compiler Collection (GCC)}, for information on environmentvariables.@xref{Runtime}, for environment variables that affect therun-time behavior of @command{gfortran} programs.@c man end

⌨️ 快捷键说明

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