diff options
author | Toon Moene <toon@moene.indiv.nluug.nl> | 2001-11-15 01:28:54 +0100 |
---|---|---|
committer | Toon Moene <toon@gcc.gnu.org> | 2001-11-15 00:28:54 +0000 |
commit | 49e197251c88b5bf2ec009ee92b4aede6677fc55 (patch) | |
tree | 62a6b1d85ceec2a8ea5d11148230142edce76e4f | |
parent | 6c5a8271d46c9ddf0ed671519dda606ea25d6611 (diff) | |
download | gcc-49e197251c88b5bf2ec009ee92b4aede6677fc55.zip gcc-49e197251c88b5bf2ec009ee92b4aede6677fc55.tar.gz gcc-49e197251c88b5bf2ec009ee92b4aede6677fc55.tar.bz2 |
g77.texi: Update to use `@command', `@option.
2001-11-14 Toon Moene <toon@moene.indiv.nluug.nl>
* g77.texi: Update to use `@command', `@option.
* invoke.texi: Ditto
From-SVN: r47034
-rw-r--r-- | gcc/f/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/f/g77.texi | 1999 | ||||
-rw-r--r-- | gcc/f/invoke.texi | 436 |
3 files changed, 1236 insertions, 1204 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 730ce5d..16f63a6 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,8 @@ +2001-11-14 Toon Moene <toon@moene.indiv.nluug.nl> + + * g77.texi: Update to use `@command', `@option. + * invoke.texi: Ditto + 2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk> * Make-lang.in: Change all uses of $(manext) to $(man1ext). diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi index 6988a7d..9331d04 100644 --- a/gcc/f/g77.texi +++ b/gcc/f/g77.texi @@ -2,7 +2,7 @@ @c %**start of header @setfilename g77.info -@set last-update 2001-06-10 +@set last-update 2001-11-14 @set copyrights-g77 1995,1996,1997,1998,1999,2000,2001 @include root.texi @@ -32,6 +32,25 @@ @c margin. -- burley 1999-03-13 (from mew's comment in gcc.texi). @c @finalout +@macro gcctabopt{body} +@code{\body\} +@end macro +@macro gccoptlist{body} +@smallexample +\body\ +@end smallexample +@end macro +@c Makeinfo handles the above macro OK, TeX needs manual line breaks; +@c they get lost at some point in handling the macro. But if @macro is +@c used here rather than @alias, it produces double line breaks. +@iftex +@alias gol = * +@end iftex +@ifnottex +@macro gol +@end macro +@end ifnottex + @ifset INTERNALS @ifset USING @settitle Using and Porting GNU Fortran @@ -77,18 +96,18 @@ @end direntry @ifset INTERNALS @ifset USING -This file documents the use and the internals of the GNU Fortran (@code{g77}) +This file documents the use and the internals of the GNU Fortran (@command{g77}) compiler. -It corresponds to the @value{which-g77} version of @code{g77}. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifset @end ifset @ifclear USING -This file documents the internals of the GNU Fortran (@code{g77}) compiler. -It corresponds to the @value{which-g77} version of @code{g77}. +This file documents the internals of the GNU Fortran (@command{g77}) compiler. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifclear @ifclear INTERNALS -This file documents the use of the GNU Fortran (@code{g77}) compiler. -It corresponds to the @value{which-g77} version of @code{g77}. +This file documents the use of the GNU Fortran (@command{g77}) compiler. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifclear Published by the Free Software Foundation @@ -187,42 +206,42 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) @ifset INTERNALS @ifset USING -This manual documents how to run, install and port @code{g77}, +This manual documents how to run, install and port @command{g77}, as well as its new features and incompatibilities, and how to report bugs. -It corresponds to the @value{which-g77} version of @code{g77}. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifset @end ifset @ifclear INTERNALS -This manual documents how to run and install @code{g77}, +This manual documents how to run and install @command{g77}, as well as its new features and incompatibilities, and how to report bugs. -It corresponds to the @value{which-g77} version of @code{g77}. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifclear @ifclear USING -This manual documents how to port @code{g77}, +This manual documents how to port @command{g77}, as well as its new features and incompatibilities, and how to report bugs. -It corresponds to the @value{which-g77} version of @code{g77}. +It corresponds to the @value{which-g77} version of @command{g77}. @end ifclear @end ifinfo @ifset DEVELOPMENT @emph{Warning:} This document is still under development, -and might not accurately reflect the @code{g77} code base +and might not accurately reflect the @command{g77} code base of which it is a part. Efforts are made to keep it somewhat up-to-date, but they are particularly concentrated on any version of this information -that is distributed as part of a @emph{released} @code{g77}. +that is distributed as part of a @emph{released} @command{g77}. In particular, while this document is intended to apply to -the @value{which-g77} version of @code{g77}, +the @value{which-g77} version of @command{g77}, only an official @emph{release} of that version is expected to contain documentation that is -most consistent with the @code{g77} product in that version. +most consistent with the @command{g77} product in that version. @end ifset @menu @@ -235,17 +254,17 @@ most consistent with the @code{g77} product in that version. * Funding GNU Fortran:: How to help assure continued work on GNU Fortran. @ifset USING * Getting Started:: Finding your way around this manual. -* What is GNU Fortran?:: How @code{g77} fits into the universe. +* What is GNU Fortran?:: How @command{g77} fits into the universe. * G77 and GCC:: You can compile Fortran, C, or other programs. -* Invoking G77:: Command options supported by @code{g77}. -* News:: News about recent releases of @code{g77}. -* Changes:: User-visible changes to recent releases of @code{g77}. +* Invoking G77:: Command options supported by @command{g77}. +* News:: News about recent releases of @command{g77}. +* Changes:: User-visible changes to recent releases of @command{g77}. * Language:: The GNU Fortran language. * Compiler:: The GNU Fortran compiler. -* Other Dialects:: Dialects of Fortran supported by @code{g77}. -* Other Compilers:: Fortran compilers other than @code{g77}. +* Other Dialects:: Dialects of Fortran supported by @command{g77}. +* Other Compilers:: Fortran compilers other than @command{g77}. * Other Languages:: Languages other than Fortran. -* Debugging and Interfacing:: How @code{g77} generates code. +* Debugging and Interfacing:: How @command{g77} generates code. * Collected Fortran Wisdom:: How to avoid Trouble. * Trouble:: If you have trouble with GNU Fortran. * Open Questions:: Things we'd like to know. @@ -253,12 +272,12 @@ most consistent with the @code{g77} product in that version. * Service:: How to find suppliers of support for GNU Fortran. @end ifset @ifset INTERNALS -* Adding Options:: Guidance on teaching @code{g77} about new options. -* Projects:: Projects for @code{g77} internals hackers. -* Front End:: Design and implementation of the @code{g77} front end. +* Adding Options:: Guidance on teaching @command{g77} about new options. +* Projects:: Projects for @command{g77} internals hackers. +* Front End:: Design and implementation of the @command{g77} front end. @end ifset -* M: Diagnostics. Diagnostics produced by @code{g77}. +* M: Diagnostics. Diagnostics produced by @command{g77}. * Index:: Index of concepts and symbol names. @end menu @@ -286,7 +305,7 @@ for more information. @item The run-time library used by GNU Fortran is a repackaged version of the @code{libf2c} library (combined from the @code{libF77} and -@code{libI77} libraries) provided as part of @code{f2c}, available for +@code{libI77} libraries) provided as part of @command{f2c}, available for free from @code{netlib} sites on the Internet. @item @@ -294,10 +313,10 @@ Cygnus Support and The Free Software Foundation contributed significant money and/or equipment to Craig's efforts. @item -The following individuals served as alpha testers prior to @code{g77}'s +The following individuals served as alpha testers prior to @command{g77}'s public release. This work consisted of testing, researching, sometimes debugging, and occasionally providing small amounts of code and fixes -for @code{g77}, plus offering plenty of helpful advice to Craig: +for @command{g77}, plus offering plenty of helpful advice to Craig: @itemize @w{} @item @@ -333,6 +352,10 @@ Ian Watson @end itemize @item +Dave Love (@email{d.love@@dl.ac.uk}) +wrote the libU77 part of the run-time library. + +@item Scott Snyder (@email{snyder@@d0sgif.fnal.gov}) provided the patch to add rudimentary support for @code{INTEGER*1}, @code{INTEGER*2}, and @@ -351,16 +374,16 @@ old @file{g77-0.5.16/f/DOC} file. @item Toon Moene (@email{toon@@moene.indiv.nluug.nl}) performed some analysis of generated code as part of an overall project -to improve @code{g77} code generation to at least be as good -as @code{f2c} used in conjunction with @code{gcc}. +to improve @command{g77} code generation to at least be as good +as @command{f2c} used in conjunction with @command{gcc}. So far, this has resulted in the three, somewhat -experimental, options added by @code{g77} to the @code{gcc} +experimental, options added by @command{g77} to the @command{gcc} compiler and its back end. (These, in turn, had made their way into the @code{egcs} -version of the compiler, and do not exist in @code{gcc} -version 2.8 or versions of @code{g77} based on that version -of @code{gcc}.) +version of the compiler, and do not exist in @command{gcc} +version 2.8 or versions of @command{g77} based on that version +of @command{gcc}.) @item John Carr (@email{jfc@@mit.edu}) wrote the alias analysis improvements. @@ -370,7 +393,7 @@ Thanks to Mary Cortani and the staff at Craftwork Solutions (@email{support@@craftwork.com}) for all of their support. @item -Many other individuals have helped debug, test, and improve @code{g77} +Many other individuals have helped debug, test, and improve @command{g77} over the past several years, and undoubtedly more people will be doing so in the future. If you have done so, and would like @@ -409,8 +432,14 @@ Work is needed on documentation, testing, porting to various machines, and in some cases, coding (although major changes planned for version 0.6 make it difficult to add manpower to this area). + Email @email{@value{email-general}} to volunteer for this work. +However, we strongly expect that there will never be a version 0.6 +of @command{g77}. Work on this compiler has stopped as of the release +of GCC 3.1, except for bug fixing. @command{g77} will be succeeded by +@command{g95} - see @uref{http://g95.sourceforge.net}. + @xref{Funding,,Funding Free Software}, for more information. @node Getting Started @@ -430,17 +459,17 @@ systems, you'll want to see @ref{What is GNU Fortran?}. If you are new to GNU compilers, or have used only one GNU compiler in the past and not had to delve into how it lets -you manage various versions and configurations of @code{gcc}, +you manage various versions and configurations of @command{gcc}, you should see @ref{G77 and GCC}. -Everyone except experienced @code{g77} users should +Everyone except experienced @command{g77} users should see @ref{Invoking G77}. -If you're acquainted with previous versions of @code{g77}, +If you're acquainted with previous versions of @command{g77}, you should see @ref{News,,News About GNU Fortran}. -Further, if you've actually used previous versions of @code{g77}, +Further, if you've actually used previous versions of @command{g77}, especially if you've written or modified Fortran code to -be compiled by previous versions of @code{g77}, you +be compiled by previous versions of @command{g77}, you should see @ref{Changes}. If you intend to write or otherwise compile code that is @@ -453,25 +482,25 @@ if you see @ref{Debugging and Interfacing}, see @ref{Collected Fortran Wisdom}, and see @ref{Trouble}. You might also find that the problems you are encountering -are bugs in @code{g77}---see @ref{Bugs}, for information on +are bugs in @command{g77}---see @ref{Bugs}, for information on reporting them, after reading the other material. -If you need further help with @code{g77}, or with +If you need further help with @command{g77}, or with freely redistributable software in general, see @ref{Service}. -If you would like to help the @code{g77} project, +If you would like to help the @command{g77} project, see @ref{Funding GNU Fortran}, for information on helping financially, and see @ref{Projects}, for information on helping in other ways. If you're generally curious about the future of -@code{g77}, see @ref{Projects}. +@command{g77}, see @ref{Projects}. If you're curious about its past, see @ref{Contributors}, and see @ref{Funding GNU Fortran}. -To see a few of the questions maintainers of @code{g77} have, +To see a few of the questions maintainers of @command{g77} have, and that you might be able to answer, see @ref{Open Questions}. @@ -481,12 +510,12 @@ see @ref{Open Questions}. @cindex concepts, basic @cindex basic concepts -GNU Fortran, or @code{g77}, is designed initially as a free replacement +GNU Fortran, or @command{g77}, is designed initially as a free replacement for, or alternative to, the UNIX @code{f77} command. -(Similarly, @code{gcc} is designed as a replacement +(Similarly, @command{gcc} is designed as a replacement for the UNIX @code{cc} command.) -@code{g77} also is designed to fit in well with the other +@command{g77} also is designed to fit in well with the other fine GNU compilers and tools. Sometimes these design goals conflict---in such cases, resolution @@ -495,7 +524,7 @@ These cases are usually identified in the appropriate sections of this manual. @cindex compilers -As compilers, @code{g77}, @code{gcc}, and @code{f77} +As compilers, @command{g77}, @command{gcc}, and @code{f77} share the following characteristics: @itemize @bullet @@ -551,7 +580,7 @@ process. (Linking often is thought of as a separate step, because it can be directly invoked via the @code{ld} command. -However, the @code{g77} and @code{gcc} +However, the @command{g77} and @command{gcc} commands, as with most compiler commands, automatically perform the linking step by calling on @code{ld} directly, unless asked to not do so by the user.) @@ -598,25 +627,25 @@ of the language), how much time to spend making the generated machine code run faster, and so on. @cindex components of g77 -@cindex @code{g77}, components of -@code{g77} consists of several components: +@cindex @command{g77}, components of +@command{g77} consists of several components: -@cindex @code{gcc}, command -@cindex commands, @code{gcc} +@cindex @command{gcc}, command +@cindex commands, @command{gcc} @itemize @bullet @item -A modified version of the @code{gcc} command, which also might be +A modified version of the @command{gcc} command, which also might be installed as the system's @code{cc} command. (In many cases, @code{cc} refers to the system's ``native'' C compiler, which might be a non-GNU compiler, or an older version -of @code{gcc} considered more stable or that is +of @command{gcc} considered more stable or that is used to build the operating system kernel.) -@cindex @code{g77}, command -@cindex commands, @code{g77} +@cindex @command{g77}, command +@cindex commands, @command{g77} @item -The @code{g77} command itself, which also might be installed as the +The @command{g77} command itself, which also might be installed as the system's @code{f77} command. @cindex libg2c library @@ -628,13 +657,13 @@ system's @code{f77} command. The @code{libg2c} run-time library. This library contains the machine code needed to support capabilities of the Fortran language that are not directly -provided by the machine code generated by the @code{g77} +provided by the machine code generated by the @command{g77} compilation phase. -@code{libg2c} is just the unique name @code{g77} gives +@code{libg2c} is just the unique name @command{g77} gives to its version of @code{libf2c} to distinguish it from -any copy of @code{libf2c} installed from @code{f2c} -(or versions of @code{g77} that built @code{libf2c} under +any copy of @code{libf2c} installed from @command{f2c} +(or versions of @command{g77} that built @code{libf2c} under that same name) on the system. @@ -657,15 +686,15 @@ of machine code, leaving the conversion to actual machine code to an @dfn{assembler}, usually named @code{as}. @end itemize -@code{gcc} is often thought of as ``the C compiler'' only, +@command{gcc} is often thought of as ``the C compiler'' only, but it does more than that. Based on command-line options and the names given for files -on the command line, @code{gcc} determines which actions to perform, including +on the command line, @command{gcc} determines which actions to perform, including preprocessing, compiling (in a variety of possible languages), assembling, and linking. @cindex driver, gcc command as -@cindex @code{gcc}, command as driver +@cindex @command{gcc}, command as driver @cindex executable file @cindex files, executable @cindex cc1 program @@ -684,35 +713,35 @@ UNIX systems). @cindex programs, cc1plus As another example, the command @samp{gcc foo.cc} would do much the same as @samp{gcc foo.c}, but instead of using the C compiler named @code{cc1}, -@code{gcc} would use the C++ compiler (named @code{cc1plus}). +@command{gcc} would use the C++ compiler (named @code{cc1plus}). @cindex @code{f771}, program @cindex programs, @code{f771} -In a GNU Fortran installation, @code{gcc} recognizes Fortran source +In a GNU Fortran installation, @command{gcc} recognizes Fortran source files by name just like it does C and C++ source files. It knows to use the Fortran compiler named @code{f771}, instead of @code{cc1} or @code{cc1plus}, to compile Fortran files. -@cindex @code{gcc}, not recognizing Fortran source +@cindex @command{gcc}, not recognizing Fortran source @cindex unrecognized file format @cindex file format not recognized -Non-Fortran-related operation of @code{gcc} is generally -unaffected by installing the GNU Fortran version of @code{gcc}. -However, without the installed version of @code{gcc} being the -GNU Fortran version, @code{gcc} will not be able to compile -and link Fortran programs---and since @code{g77} uses @code{gcc} -to do most of the actual work, neither will @code{g77}! - -@cindex @code{g77}, command -@cindex commands, @code{g77} -The @code{g77} command is essentially just a front-end for -the @code{gcc} command. -Fortran users will normally use @code{g77} instead of @code{gcc}, -because @code{g77} +Non-Fortran-related operation of @command{gcc} is generally +unaffected by installing the GNU Fortran version of @command{gcc}. +However, without the installed version of @command{gcc} being the +GNU Fortran version, @command{gcc} will not be able to compile +and link Fortran programs---and since @command{g77} uses @command{gcc} +to do most of the actual work, neither will @command{g77}! + +@cindex @command{g77}, command +@cindex commands, @command{g77} +The @command{g77} command is essentially just a front-end for +the @command{gcc} command. +Fortran users will normally use @command{g77} instead of @command{gcc}, +because @command{g77} knows how to specify the libraries needed to link with Fortran programs (@code{libg2c} and @code{lm}). -@code{g77} can still compile and link programs and -source files written in other languages, just like @code{gcc}. +@command{g77} can still compile and link programs and +source files written in other languages, just like @command{gcc}. @cindex printing version information @cindex version information, printing @@ -726,8 +755,8 @@ have an out-of-date @code{libf2c} that improperly handles complex arithmetic.) In the output of this command, the line beginning @samp{GNU Fortran Front End} identifies the version number of GNU Fortran; immediately -preceding that line is a line identifying the version of @code{gcc} -with which that version of @code{g77} was built. +preceding that line is a line identifying the version of @command{gcc} +with which that version of @command{g77} was built. @cindex libf2c library @cindex libraries, libf2c @@ -738,32 +767,32 @@ needed by Fortran programs while they are running. @cindex in-line code @cindex code, in-line -For example, while code generated by @code{g77} is likely +For example, while code generated by @command{g77} is likely to do additions, subtractions, and multiplications @dfn{in line}---in the actual compiled code---it is not likely to do trigonometric functions this way. Instead, operations like trigonometric functions are compiled by the @code{f771} compiler -(invoked by @code{g77} when compiling Fortran code) into machine +(invoked by @command{g77} when compiling Fortran code) into machine code that, when run, calls on functions in @code{libg2c}, so @code{libg2c} must be linked with almost every useful program having any component compiled by GNU Fortran. -(As mentioned above, the @code{g77} command takes +(As mentioned above, the @command{g77} command takes care of all this for you.) The @code{f771} program represents most of what is unique to GNU Fortran. While much of the @code{libg2c} component comes from -the @code{libf2c} component of @code{f2c}, +the @code{libf2c} component of @command{f2c}, a free Fortran-to-C converter distributed by Bellcore (AT&T), plus @code{libU77}, provided by Dave Love, -and the @code{g77} command is just a small front-end to @code{gcc}, +and the @command{g77} command is just a small front-end to @command{gcc}, @code{f771} is a combination of two rather large chunks of code. @cindex GNU Back End (GBE) @cindex GBE -@cindex @code{gcc}, back end +@cindex @command{gcc}, back end @cindex back end, gcc @cindex code generator One chunk is the so-called @dfn{GNU Back End}, or GBE, @@ -776,8 +805,8 @@ whenever the distinction is important. @cindex GNU Fortran Front End (FFE) @cindex FFE -@cindex @code{g77}, front end -@cindex front end, @code{g77} +@cindex @command{g77}, front end +@cindex front end, @command{g77} The other chunk of @code{f771} is the majority of what is unique about GNU Fortran---the code that knows how to interpret Fortran programs to determine what they are intending to @@ -798,7 +827,7 @@ much of the behavior and many of the user-selectable options for these compilers are similar. For example, diagnostics (error messages and warnings) are similar in appearance; command-line -options like @samp{-Wall} have generally similar effects; and the quality +options like @option{-Wall} have generally similar effects; and the quality of generated code (in terms of speed and size) is roughly similar (since that work is done by the shared GBE). @@ -807,38 +836,38 @@ of generated code (in terms of speed and size) is roughly similar @cindex compiling programs @cindex programs, compiling -@cindex @code{gcc}, command -@cindex commands, @code{gcc} -A GNU Fortran installation includes a modified version of the @code{gcc} +@cindex @command{gcc}, command +@cindex commands, @command{gcc} +A GNU Fortran installation includes a modified version of the @command{gcc} command. -In a non-Fortran installation, @code{gcc} recognizes C, C++, +In a non-Fortran installation, @command{gcc} recognizes C, C++, and Objective-C source files. -In a GNU Fortran installation, @code{gcc} also recognizes Fortran source +In a GNU Fortran installation, @command{gcc} also recognizes Fortran source files and accepts Fortran-specific command-line options, plus some command-line options that are designed to cater to Fortran users but apply to other languages as well. @xref{G++ and GCC,,Compile C; C++; or Objective-C,gcc,Using and Porting GNU CC}, for information on the way different languages are handled -by the GNU CC compiler (@code{gcc}). +by the GNU CC compiler (@command{gcc}). -@cindex @code{g77}, command -@cindex commands, @code{g77} -Also provided as part of GNU Fortran is the @code{g77} command. -The @code{g77} command is designed to make compiling and linking Fortran -programs somewhat easier than when using the @code{gcc} command for +@cindex @command{g77}, command +@cindex commands, @command{g77} +Also provided as part of GNU Fortran is the @command{g77} command. +The @command{g77} command is designed to make compiling and linking Fortran +programs somewhat easier than when using the @command{gcc} command for these tasks. It does this by analyzing the command line somewhat and changing it -appropriately before submitting it to the @code{gcc} command. +appropriately before submitting it to the @command{gcc} command. @cindex -v option -@cindex @code{g77} options, -v +@cindex @command{g77} options, -v @cindex options, -v -Use the @samp{-v} option with @code{g77} +Use the @option{-v} option with @command{g77} to see what is going on---the first line of output is the invocation -of the @code{gcc} command. +of the @command{gcc} command. @include invoke.texi @@ -862,7 +891,7 @@ the network at or as monolithic text at @uref{http://www.fortran.com/fortran/F77_std/f77_std.html}. It offers some extensions that are popular among users -of UNIX @code{f77} and @code{f2c} compilers, some that +of UNIX @code{f77} and @command{f2c} compilers, some that are popular among users of other compilers (such as Digital products), some that are popular among users of the newer Fortran 90 standard, and some that are introduced @@ -874,10 +903,10 @@ a few freely available electronic references have pointers from @uref{http://www.fortran.com/fortran/Books/}. There is a `cooperative net project', @cite{User Notes on Fortran Programming} at @uref{ftp://vms.huji.ac.il/fortran/} and mirrors elsewhere; some of this -material might not apply specifically to @code{g77}.) +material might not apply specifically to @command{g77}.) Part of what defines a particular implementation of a Fortran -system, such as @code{g77}, is the particular characteristics +system, such as @command{g77}, is the particular characteristics of how it supports types, constants, and so on. Much of this is left up to the implementation by the various Fortran standards and accepted practice in the industry. @@ -886,7 +915,7 @@ The GNU Fortran @emph{language} is described below. Much of the material is organized along the same lines as the ANSI FORTRAN 77 standard itself. -@xref{Other Dialects}, for information on features @code{g77} supports +@xref{Other Dialects}, for information on features @command{g77} supports that are not part of the GNU Fortran language. @emph{Note}: This portion of the documentation definitely needs a lot @@ -922,19 +951,19 @@ The purpose of the following description of the GNU Fortran language is to promote wide portability of GNU Fortran programs. GNU Fortran is an evolving language, due to the -fact that @code{g77} itself is in beta test. +fact that @command{g77} itself is in beta test. Some current features of the language might later -be redefined as dialects of Fortran supported by @code{g77} -when better ways to express these features are added to @code{g77}, +be redefined as dialects of Fortran supported by @command{g77} +when better ways to express these features are added to @command{g77}, for example. Such features would still be supported by -@code{g77}, but would be available only when +@command{g77}, but would be available only when one or more command-line options were used. The GNU Fortran @emph{language} is distinct from the -GNU Fortran @emph{compilation system} (@code{g77}). +GNU Fortran @emph{compilation system} (@command{g77}). -For example, @code{g77} supports various dialects of +For example, @command{g77} supports various dialects of Fortran---in a sense, these are languages other than GNU Fortran---though its primary purpose is to support the GNU Fortran language, which also is @@ -945,18 +974,18 @@ support for the GNU Fortran language, and are encouraged to do so. Currently, the GNU Fortran language is a fairly fuzzy object. -It represents something of a cross between what @code{g77} accepts +It represents something of a cross between what @command{g77} accepts when compiling using the prevailing defaults and what this document describes as being part of the language. -Future versions of @code{g77} are expected to clarify the +Future versions of @command{g77} are expected to clarify the definition of the language in the documentation. Often, this will mean adding new features to the language, in the form -of both new documentation and new support in @code{g77}. +of both new documentation and new support in @command{g77}. However, it might occasionally mean removing a feature from the language itself to ``dialect'' status. In such a case, the documentation would be adjusted -to reflect the change, and @code{g77} itself would likely be changed +to reflect the change, and @command{g77} itself would likely be changed to require one or more command-line options to continue supporting the feature. @@ -1032,10 +1061,10 @@ sense that its users can use it in the same way, and expect largely the same behaviors from it, regardless of the kind of system they are using at any particular time. -This approach constrains the solutions @code{g77} can use to resolve +This approach constrains the solutions @command{g77} can use to resolve conflicts between various camps of Fortran users. If these two camps disagree about what a particular construct should -mean, @code{g77} cannot simply be changed to treat that particular construct as +mean, @command{g77} cannot simply be changed to treat that particular construct as having one meaning without comment (such as a warning), lest the users expecting it to have the other meaning are unpleasantly surprised that their code misbehaves when executed. @@ -1044,19 +1073,19 @@ The use of the ASCII backslash character in character constants is an excellent (and still somewhat unresolved) example of this kind of controversy. @xref{Backslash in Constants}. -Other examples are likely to arise in the future, as @code{g77} developers +Other examples are likely to arise in the future, as @command{g77} developers strive to improve its ability to accept an ever-wider variety of existing Fortran code without requiring significant modifications to said code. Development of GNU Fortran is further constrained by the desire to avoid requiring programmers to change their code. This is important because it allows programmers, administrators, -and others to more faithfully evaluate and validate @code{g77} +and others to more faithfully evaluate and validate @command{g77} (as an overall product and as new versions are distributed) without having to support multiple versions of their programs so that they continue to work the same way on their existing systems (non-GNU perhaps, but possibly also earlier versions -of @code{g77}). +of @command{g77}). @node Standard Support @section ANSI FORTRAN 77 Standard Support @@ -1067,7 +1096,7 @@ of @code{g77}). @cindex FORTRAN 77 compatibility GNU Fortran supports ANSI FORTRAN 77 with the following caveats. -In summary, the only ANSI FORTRAN 77 features @code{g77} doesn't +In summary, the only ANSI FORTRAN 77 features @command{g77} doesn't support are those that are probably rarely used in actual code, some of which are explicitly disallowed by the Fortran 90 standard. @@ -1081,7 +1110,7 @@ some of which are explicitly disallowed by the Fortran 90 standard. @node No Passing External Assumed-length @subsection No Passing External Assumed-length -@code{g77} disallows passing of an external procedure +@command{g77} disallows passing of an external procedure as an actual argument if the procedure's type is declared @code{CHARACTER*(*)}. For example: @@ -1098,7 +1127,7 @@ It isn't clear whether the standard considers this conforming. @node No Passing Dummy Assumed-length @subsection No Passing Dummy Assumed-length -@code{g77} disallows passing of a dummy procedure +@command{g77} disallows passing of a dummy procedure as an actual argument if the procedure's type is declared @code{CHARACTER*(*)}. @@ -1119,7 +1148,7 @@ It isn't clear whether the standard considers this conforming. The @code{DO} variable for an implied-@code{DO} construct in a @code{DATA} statement may not be used as the @code{DO} variable for an outer implied-@code{DO} construct. For example, this -fragment is disallowed by @code{g77}: +fragment is disallowed by @command{g77}: @smallexample DATA ((A(I, I), I= 1, 10), I= 1, 10) /@dots{}/ @@ -1138,7 +1167,7 @@ tries to use this unsupported construct. An array element initializer in an implied-@code{DO} construct in a @code{DATA} statement must contain at least one reference to the @code{DO} variables of each outer implied-@code{DO} construct. For example, -this fragment is disallowed by @code{g77}: +this fragment is disallowed by @command{g77}: @smallexample DATA (A, I= 1, 1) /1./ @@ -1147,7 +1176,7 @@ DATA (A, I= 1, 1) /1./ @noindent This also is disallowed by Fortran 90, as FORTRAN 77's more permissive requirements offer no additional capabilities. -However, @code{g77} doesn't necessarily diagnose all cases +However, @command{g77} doesn't necessarily diagnose all cases where this requirement is not met. Note that it is @emph{very} unlikely that any production Fortran code @@ -1167,12 +1196,12 @@ the ANSI FORTRAN 77 language in that it does not generally require conforming implementations to diagnose cases where programs do not conform to the language. -However, @code{g77} as a compiler is being developed in a way that +However, @command{g77} as a compiler is being developed in a way that is intended to enable it to diagnose such cases in an easy-to-understand manner. A program that conforms to the GNU Fortran language should, when -compiled, linked, and executed using a properly installed @code{g77} +compiled, linked, and executed using a properly installed @command{g77} system, perform as described by the GNU Fortran language definition. Reasons for different behavior include, among others: @@ -1193,21 +1222,21 @@ Excessive reliance on behaviors that are system-dependent Bugs in the program. @item -Bug in @code{g77}. +Bug in @command{g77}. @item Bugs in the system. @end itemize Despite these ``loopholes'', the availability of a clear specification -of the language of programs submitted to @code{g77}, as this document +of the language of programs submitted to @command{g77}, as this document is intended to provide, is considered an important aspect of providing a robust, clean, predictable Fortran implementation. The definition of the GNU Fortran language, while having no special legal status, can therefore be viewed as a sort of contract, or agreement. This agreement says, in essence, ``if you write a program in this language, -and run it in an environment (such as a @code{g77} system) that supports +and run it in an environment (such as a @command{g77} system) that supports this language, the program should behave in a largely predictable way''. @node Notation Used @@ -1420,7 +1449,7 @@ Some readers might think the @samp{CALL BAR} is executed only if @samp{VALIDP} is @code{.TRUE.}, while others might assume its execution is unconditional. -(At present, @code{g77} does not diagnose code that +(At present, @command{g77} does not diagnose code that violates this restriction.) @end itemize @@ -1755,9 +1784,9 @@ which is a literal GNU Fortran character constant. The meaning and interpretation of @var{filename} depends on the implementation, but typically is a filename. -(@code{g77} treats it as a filename that it searches for +(@command{g77} treats it as a filename that it searches for in the current directory and/or directories specified -via the @samp{-I} command-line option.) +via the @option{-I} command-line option.) The effect of the @code{INCLUDE} directive is as if the included text directly replaced the directive in the source @@ -1866,7 +1895,7 @@ notation for clarification, though the traditional notation might not work the same way on all GNU Fortran implementations. Use of @samp{KIND=} makes this document more concise because -@code{g77} is able to define values for @samp{KIND=} that +@command{g77} is able to define values for @samp{KIND=} that have the same meanings on all systems, due to the way the Fortran 90 standard specifies these values are to be used. @@ -1887,7 +1916,7 @@ operating system. However, use of @samp{KIND=} is @emph{not} generally recommended when writing portable code (unless, for example, the code is -going to be compiled only via @code{g77}, which is a widely +going to be compiled only via @command{g77}, which is a widely ported compiler). GNU Fortran does not yet have adequate language constructs to permit use of @samp{KIND=} in a fashion that would make the @@ -1910,7 +1939,7 @@ to specify the types in a fashion that may be easily adjusted to suit each particular implementation to which the program is ported. (These types generally won't need to be adjusted for ports of -@code{g77}.) +@command{g77}.) Further details regarding GNU Fortran data types and constants are provided below. @@ -2036,9 +2065,9 @@ in any particular way---use explicit code to do that. Further, the GNU Fortran language requires no particular values for @var{n} to be supported by an implementation via the @samp{*@var{n}} notation. -@code{g77} supports @code{INTEGER*1} (as @code{INTEGER(KIND=3)}) +@command{g77} supports @code{INTEGER*1} (as @code{INTEGER(KIND=3)}) on all systems, for example, -but not all implementations are required to do so, and @code{g77} +but not all implementations are required to do so, and @command{g77} is known to not support @code{REAL*1} on most (or all) systems. As a result, except for @var{generic-type} of @code{CHARACTER}, @@ -2105,7 +2134,7 @@ Programmers are discouraged from writing these values directly into their code. Future versions of the GNU Fortran language will offer facilities that will make the writing of code portable -to @code{g77} @emph{and} Fortran 90 implementations simpler. +to @command{g77} @emph{and} Fortran 90 implementations simpler. However, writing code that ports to existing FORTRAN 77 implementations depends on avoiding the @samp{KIND=} construct. @@ -2250,8 +2279,8 @@ be the same size and semantics of the C type @code{void *}.) @end table Note that these are @emph{proposed} correspondences and might change -in future versions of @code{g77}---avoid writing code depending -on them while @code{g77}, and therefore the GNU Fortran language +in future versions of @command{g77}---avoid writing code depending +on them while @command{g77}, and therefore the GNU Fortran language it defines, is in beta testing. Values not specified in the above list are reserved to @@ -2349,7 +2378,7 @@ is 11, and so on.) A prefix-radix constant, such as @samp{Z'ABCD'}, can optionally be treated as typeless. @xref{Fortran Dialect Options,, Options Controlling Fortran Dialect}, for information on the -@samp{-ftypeless-boz} option. +@option{-ftypeless-boz} option. Typeless constants have values that depend on the context in which they are used. @@ -2464,7 +2493,7 @@ While this might work in some circumstances, it is hard to predict whether it will continue to work when a program (that works using this unsafe behavior) is recompiled using different command-line options or -a different version of @code{g77}. +a different version of @command{g77}. Generally, @code{%LOC()} is safe when used as an argument to a procedure that makes use of the value of the corresponding @@ -2472,7 +2501,7 @@ dummy argument only during its activation, and only when such use is restricted to referencing (reading) the value of the argument to @code{%LOC()}. -@emph{Implementation Note:} Currently, @code{g77} passes +@emph{Implementation Note:} Currently, @command{g77} passes arguments (those not passed using a construct such as @code{%VAL()}) by reference or descriptor, depending on the type of the actual argument. @@ -2483,7 +2512,7 @@ in fact might compile to identical code. However, @samp{CALL FOO(%VAL(%LOC(I)))} emphatically means ``pass, by value, the address of @samp{I} in memory''. While @samp{CALL FOO(I)} might use that same approach in a -particular version of @code{g77}, another version or compiler +particular version of @command{g77}, another version or compiler might choose a different implementation, such as copy-in/copy-out, to effect the desired behavior---and which will therefore not necessarily compile to the same code as would @@ -2491,7 +2520,7 @@ necessarily compile to the same code as would using the same version or compiler. @xref{Debugging and Interfacing}, for detailed information on -how this particular version of @code{g77} implements various +how this particular version of @command{g77} implements various constructs. @node Specification Statements @@ -2515,7 +2544,7 @@ for the relevant aspects of GNU Fortran.) The @code{NAMELIST} statement, and related I/O constructs, are supported by the GNU Fortran language in essentially the same -way as they are by @code{f2c}. +way as they are by @command{f2c}. This follows Fortran 90 with the restriction that on @code{NAMELIST} input, subscripts must have the form @@ -2599,7 +2628,7 @@ is labeled and a target of one or more labeled @code{DO} loops. It is expected that this use of @code{END DO} will be removed from the GNU Fortran language in the future, though it is likely that -it will long be supported by @code{g77} as a dialect form. +it will long be supported by @command{g77} as a dialect form. @end itemize @node Construct Names @@ -2780,7 +2809,7 @@ use by the program as a whole, but are themselves not portable, and should be thoroughly tested each time they are rebuilt using a new compiler or version of a compiler. -@emph{Implementation Note:} Currently, @code{g77} passes +@emph{Implementation Note:} Currently, @command{g77} passes all arguments either by reference or by descriptor. Thus, use of @code{%VAL()} tends to be restricted to cases @@ -2790,7 +2819,7 @@ than Fortran that supports call-by-value semantics. @xref{Procedures,,Procedures (SUBROUTINE and FUNCTION)}, for detailed information on -how this particular version of @code{g77} passes arguments +how this particular version of @command{g77} passes arguments to procedures. @node %REF() @@ -2827,11 +2856,11 @@ pass-by-reference semantics without passing a pointer to the argument, @var{arg}. (For example, a copy-in/copy-out implementation.) -@emph{Implementation Note:} Currently, @code{g77} passes +@emph{Implementation Note:} Currently, @command{g77} passes all arguments (other than variables and arrays of type @code{CHARACTER}) by reference. -Future versions of, or dialects supported by, @code{g77} might +Future versions of, or dialects supported by, @command{g77} might not pass @code{CHARACTER} functions by reference. Thus, use of @code{%REF()} tends to be restricted to cases @@ -2840,7 +2869,7 @@ procedure accesses it via a means other than the method used for Fortran @code{CHARACTER} arguments. @xref{Procedures,,Procedures (SUBROUTINE and FUNCTION)}, for detailed information on -how this particular version of @code{g77} passes arguments +how this particular version of @command{g77} passes arguments to procedures. @node %DESCR() @@ -2877,16 +2906,16 @@ implementation choices are available that preserve the pass-by-reference semantics without passing a pointer to the argument, @var{arg}. (For example, a copy-in/copy-out implementation.) -And, future versions of @code{g77} might change the +And, future versions of @command{g77} might change the way descriptors are implemented, such as passing a single argument pointing to a record containing the pointer/length information instead of passing that same information via two arguments as it currently does. -@emph{Implementation Note:} Currently, @code{g77} passes +@emph{Implementation Note:} Currently, @command{g77} passes all variables and arrays of type @code{CHARACTER} by descriptor. -Future versions of, or dialects supported by, @code{g77} might +Future versions of, or dialects supported by, @command{g77} might pass @code{CHARACTER} functions by descriptor as well. Thus, use of @code{%DESCR()} tends to be restricted to cases @@ -2895,7 +2924,7 @@ procedure accesses it via a means similar to the method used for Fortran @code{CHARACTER} arguments. @xref{Procedures,,Procedures (SUBROUTINE and FUNCTION)}, for detailed information on -how this particular version of @code{g77} passes arguments +how this particular version of @command{g77} passes arguments to procedures. @node Generics and Specifics @@ -3168,8 +3197,8 @@ thus ``smooshed'' by FORTRAN 77 into a single intrinsic, since they happened to have the exact same effect in that language (due to having only one @code{COMPLEX} type). -@emph{Note:} When @samp{-ff90} is in effect, -@code{g77} treats @samp{REAL(@var{expr})}, where @var{expr} is of +@emph{Note:} When @option{-ff90} is in effect, +@command{g77} treats @samp{REAL(@var{expr})}, where @var{expr} is of type @code{COMPLEX}, as @samp{REALPART(@var{expr})}, whereas with @samp{-fugly-complex -fno-f90} in effect, it is treated as @samp{REAL(REALPART(@var{expr}))}. @@ -3207,7 +3236,7 @@ Fortran 90 extends the @code{CMPLX()} intrinsic by adding an extra argument used to specify the desired kind of complex result. However, this solution is somewhat awkward to use, and -@code{g77} currently does not support it. +@command{g77} currently does not support it. The GNU Fortran language provides a simple way to build a complex value out of two numbers, with the precise type of the value @@ -3234,10 +3263,10 @@ The GNU Fortran language includes the MIL-STD 1753 intrinsics @code{ISHFTC}, @code{MVBITS}, and @code{NOT}. @node f77/f2c Intrinsics -@subsection @code{f77}/@code{f2c} Intrinsics +@subsection @code{f77}/@command{f2c} Intrinsics The bit-manipulation intrinsics supported by traditional -@code{f77} and by @code{f2c} are available in the GNU Fortran language. +@code{f77} and by @command{f2c} are available in the GNU Fortran language. These include @code{AND}, @code{LSHIFT}, @code{OR}, @code{RSHIFT}, and @code{XOR}. @@ -3405,11 +3434,11 @@ the Fortran 90 features supported by the GNU Fortran language, even if they are documented elsewhere. @xref{Characters Lines Sequence,,@asis{Characters, Lines, and Execution Sequence}}, for information on additional fixed source form lexical issues. -@cindex @samp{-ffree-form} +@cindex @option{-ffree-form} Further, the free source form is supported through the -@samp{-ffree-form} option. -@cindex @samp{-ff90} -Other Fortran 90 features can be turned on by the @samp{-ff90} option; +@option{-ffree-form} option. +@cindex @option{-ff90} +Other Fortran 90 features can be turned on by the @option{-ff90} option; see @ref{Fortran 90}. For information on the Fortran 90 intrinsics available, see @ref{Table of Intrinsic Functions}. @@ -3484,12 +3513,12 @@ CHARACTER (LEN=3) FOO GNU Fortran supports a variety of features that are not considered part of the GNU Fortran language itself, but are representative of various dialects of Fortran that -@code{g77} supports in whole or in part. +@command{g77} supports in whole or in part. Any of the features listed below might be disallowed by -@code{g77} unless some command-line option is specified. +@command{g77} unless some command-line option is specified. Currently, some of the features are accepted using the -default invocation of @code{g77}, but that might change +default invocation of @command{g77}, but that might change in the future. @emph{Note: This portion of the documentation definitely needs a lot @@ -3534,12 +3563,12 @@ implementation choices made for the compiler, since those choices are explicitly left to the implementation by the published Fortran standards. GNU Fortran currently tries to be somewhat like a few popular compilers -(@code{f2c}, Digital (``DEC'') Fortran, and so on), though a cleaner default +(@command{f2c}, Digital (``DEC'') Fortran, and so on), though a cleaner default definition along with more flexibility offered by command-line options is likely to be offered in version 0.6. -This section describes how @code{g77} interprets source lines. +This section describes how @command{g77} interprets source lines. @menu * Carriage Returns:: Carriage returns ignored. @@ -3554,7 +3583,7 @@ This section describes how @code{g77} interprets source lines. @cindex carriage returns Carriage returns (@samp{\r}) in source lines are ignored. -This is somewhat different from @code{f2c}, which seems to treat them as +This is somewhat different from @command{f2c}, which seems to treat them as spaces outside character/Hollerith constants, and encodes them as @samp{\r} inside such constants. @@ -3566,12 +3595,12 @@ inside such constants. A source line with a @key{TAB} character anywhere in it is treated as entirely significant---however long it is---instead of ending in column 72 (for fixed-form source) or 132 (for free-form source). -This also is different from @code{f2c}, which encodes tabs as +This also is different from @command{f2c}, which encodes tabs as @samp{\t} (the ASCII @key{TAB} character) inside character and Hollerith constants, but nevertheless seems to treat the column position as if it had been affected by the canonical tab positioning. -@code{g77} effectively +@command{g77} effectively translates tabs to the appropriate number of spaces (a la the default for the UNIX @code{expand} command) before doing any other processing, other than (currently) noting whether a tab was found on a line and using this @@ -3610,13 +3639,13 @@ interpretation than provided by some other popular compilers basis of Fortran and the way the Fortran standard expressed fixed source form). -@code{g77} might someday offer an option to warn about cases where differences +@command{g77} might someday offer an option to warn about cases where differences might be seen as a result of this treatment, and perhaps an option to specify the alternate behavior as well. Note that this padding cannot apply to lines that are effectively of infinite length---such lines are specified using command-line options -like @samp{-ffixed-line-length-none}, for example. +like @option{-ffixed-line-length-none}, for example. @node Long Lines @subsection Long Lines @@ -3627,12 +3656,12 @@ like @samp{-ffixed-line-length-none}, for example. Source lines longer than the applicable length are truncated to that length. -Currently, @code{g77} does not warn if the truncated characters are +Currently, @command{g77} does not warn if the truncated characters are not spaces, to accommodate existing code written for systems that treated truncated text as commentary (especially in columns 73 through 80). @xref{Fortran Dialect Options,,Options Controlling Fortran Dialect}, -for information on the @samp{-ffixed-line-length-@var{n}} option, +for information on the @option{-ffixed-line-length-@var{n}} option, which can be used to set the line length applicable to fixed-form source files. @@ -3642,7 +3671,7 @@ source files. @cindex continuation line, ampersand A @samp{&} in column 1 of fixed-form source denotes an arbitrary-length -continuation line, imitating the behavior of @code{f2c}. +continuation line, imitating the behavior of @command{f2c}. @node Trailing Comment @section Trailing Comment @@ -3653,7 +3682,7 @@ continuation line, imitating the behavior of @code{f2c}. @cindex /* @cindex ! @cindex exclamation point -@code{g77} supports use of @samp{/*} to start a trailing +@command{g77} supports use of @samp{/*} to start a trailing comment. In the GNU Fortran language, @samp{!} is used for this purpose. @@ -3685,7 +3714,7 @@ When treated as a comment line, a line beginning with @samp{D} or When treated as a normal line, such a line is treated as if the first character was @key{SPC} (space). -(Currently, @code{g77} provides no means for treating debug +(Currently, @command{g77} provides no means for treating debug lines as normal lines.) @node Dollar Signs @@ -3694,7 +3723,7 @@ lines as normal lines.) @cindex $ Dollar signs (@samp{$}) are allowed in symbol names (after the first character) -when the @samp{-fdollar-ok} option is specified. +when the @option{-fdollar-ok} option is specified. @node Case Sensitivity @section Case Sensitivity @@ -3780,7 +3809,7 @@ Allow InitialCaps Only (see Note 2) @end itemize @end itemize -Note 1: @code{g77} eventually will support @code{NAMELIST} in a manner that is +Note 1: @command{g77} eventually will support @code{NAMELIST} in a manner that is consistent with these source switches---in the sense that input will be expected to meet the same requirements as source code in terms of matching symbol names and keywords (for the exponent letters). @@ -3919,19 +3948,19 @@ option names that set some of these combinations all at once: Number 22 is the ``strict'' ANSI FORTRAN 77 model wherein all input (except comments, character constants, and Hollerith strings) must be entered in uppercase. -Use @samp{-fcase-strict-upper} to specify this +Use @option{-fcase-strict-upper} to specify this combination. Number 43 is like Number 22 except all input must be lowercase. Use -@samp{-fcase-strict-lower} to specify this combination. +@option{-fcase-strict-lower} to specify this combination. Number 65 is the ``classic'' ANSI FORTRAN 77 model as implemented on many non-UNIX machines whereby all the source is translated to uppercase. -Use @samp{-fcase-upper} to specify this combination. +Use @option{-fcase-upper} to specify this combination. Number 66 is the ``canonical'' UNIX model whereby all the source is translated to lowercase. -Use @samp{-fcase-lower} to specify this combination. +Use @option{-fcase-lower} to specify this combination. There are a few nearly useless combinations: @@ -3975,7 +4004,7 @@ than comments). @cindex VXT extensions @cindex extensions, VXT -@code{g77} supports certain constructs that +@command{g77} supports certain constructs that have different meanings in VXT Fortran than they do in the GNU Fortran language. @@ -3990,10 +4019,10 @@ Corporation.) An extension offered by a Digital Fortran product that also is offered by several other Fortran products for different kinds of -systems is probably going to be considered for inclusion in @code{g77} +systems is probably going to be considered for inclusion in @command{g77} someday, and is considered a VXT Fortran feature. -The @samp{-fvxt} option generally specifies that, where +The @option{-fvxt} option generally specifies that, where the meaning of a construct is ambiguous (means one thing in GNU Fortran and another in VXT Fortran), the VXT Fortran meaning is to be assumed. @@ -4011,9 +4040,9 @@ meaning is to be assumed. @cindex octal constants @cindex constants, octal -@code{g77} treats double-quote (@samp{"}) +@command{g77} treats double-quote (@samp{"}) as beginning an octal constant of @code{INTEGER(KIND=1)} type -when the @samp{-fvxt} option is specified. +when the @option{-fvxt} option is specified. The form of this octal constant is @example @@ -4024,7 +4053,7 @@ The form of this octal constant is where @var{octal-digits} is a nonempty string of characters in the set @samp{01234567}. -For example, the @samp{-fvxt} option permits this: +For example, the @option{-fvxt} option permits this: @example PRINT *, "20 @@ -4052,12 +4081,12 @@ both constructs in the general case, since statements like @cindex comment character @cindex characters, comment -@code{g77} treats an exclamation point (@samp{!}) in column 6 of +@command{g77} treats an exclamation point (@samp{!}) in column 6 of a fixed-form source file as a continuation character rather than as the beginning of a comment (as it does in any other column) -when the @samp{-fvxt} option is specified. +when the @option{-fvxt} option is specified. The following program, when run, prints a message indicating whether it is interpreted according to GNU Fortran (and Fortran 90) @@ -4083,19 +4112,19 @@ marks a line as a continuation line when it appears in column 6.) @cindex Fortran 90, compatibility The GNU Fortran language includes a number of features that are -part of Fortran 90, even when the @samp{-ff90} option is not specified. -The features enabled by @samp{-ff90} are intended to be those that, -when @samp{-ff90} is not specified, would have another -meaning to @code{g77}---usually meaning something invalid in the +part of Fortran 90, even when the @option{-ff90} option is not specified. +The features enabled by @option{-ff90} are intended to be those that, +when @option{-ff90} is not specified, would have another +meaning to @command{g77}---usually meaning something invalid in the GNU Fortran language. -So, the purpose of @samp{-ff90} is not to specify whether @code{g77} is +So, the purpose of @option{-ff90} is not to specify whether @command{g77} is to gratuitously reject Fortran 90 constructs. -The @samp{-pedantic} option specified with @samp{-fno-f90} is intended +The @option{-pedantic} option specified with @option{-fno-f90} is intended to do that, although its implementation is certainly incomplete at this point. -When @samp{-ff90} is specified: +When @option{-ff90} is specified: @itemize @bullet @item @@ -4105,7 +4134,7 @@ is the same type as the real part of @var{expr}. For example, assuming @samp{Z} is type @code{COMPLEX(KIND=2)}, @samp{REAL(Z)} would return a value of type @code{REAL(KIND=2)}, -not of type @code{REAL(KIND=1)}, since @samp{-ff90} is specified. +not of type @code{REAL(KIND=1)}, since @option{-ff90} is specified. @end itemize @node Pedantic Compilation @@ -4113,19 +4142,19 @@ not of type @code{REAL(KIND=1)}, since @samp{-ff90} is specified. @cindex pedantic compilation @cindex compilation, pedantic -The @samp{-fpedantic} command-line option specifies that @code{g77} +The @option{-fpedantic} command-line option specifies that @command{g77} is to warn about code that is not standard-conforming. This is useful for finding -some extensions @code{g77} accepts that other compilers might not accept. -(Note that the @samp{-pedantic} and @samp{-pedantic-errors} options -always imply @samp{-fpedantic}.) +some extensions @command{g77} accepts that other compilers might not accept. +(Note that the @option{-pedantic} and @option{-pedantic-errors} options +always imply @option{-fpedantic}.) -With @samp{-fno-f90} in force, ANSI FORTRAN 77 is used as the standard +With @option{-fno-f90} in force, ANSI FORTRAN 77 is used as the standard for conforming code. -With @samp{-ff90} in force, Fortran 90 is used. +With @option{-ff90} in force, Fortran 90 is used. -The constructs for which @code{g77} issues diagnostics when @samp{-fpedantic} -and @samp{-fno-f90} are in force are: +The constructs for which @command{g77} issues diagnostics when @option{-fpedantic} +and @option{-fno-f90} are in force are: @itemize @bullet @item @@ -4239,7 +4268,7 @@ Specification statements following first @code{DATA} statement. (In the GNU Fortran language, @samp{DATA I/1/} may be followed by @samp{INTEGER J}, but not @samp{INTEGER I}. -The @samp{-fpedantic} option disallows both of these.) +The @option{-fpedantic} option disallows both of these.) @item Semicolon as statement separator, as in: @@ -4265,7 +4294,7 @@ Expressions having two arithmetic operators in a row, such as @samp{X*-Y}. @end itemize -If @samp{-fpedantic} is specified along with @samp{-ff90}, the +If @option{-fpedantic} is specified along with @option{-ff90}, the following constructs result in diagnostics: @itemize @bullet @@ -4280,7 +4309,7 @@ that has an @code{INCLUDE} directive. @cindex ugly features @cindex features, ugly -The @samp{-fugly-*} command-line options determine whether certain +The @option{-fugly-*} command-line options determine whether certain features supported by VAX FORTRAN and other such compilers, but considered too ugly to be in code that can be changed to use safer and/or more portable constructs, are accepted. @@ -4288,13 +4317,13 @@ These are humorously referred to as ``distensions'', extensions that just plain look ugly in the harsh light of day. @menu -* Ugly Implicit Argument Conversion:: Disabled via @samp{-fno-ugly-args}. -* Ugly Assumed-Size Arrays:: Enabled via @samp{-fugly-assumed}. -* Ugly Null Arguments:: Enabled via @samp{-fugly-comma}. -* Ugly Complex Part Extraction:: Enabled via @samp{-fugly-complex}. -* Ugly Conversion of Initializers:: Disabled via @samp{-fno-ugly-init}. -* Ugly Integer Conversions:: Enabled via @samp{-fugly-logint}. -* Ugly Assigned Labels:: Enabled via @samp{-fugly-assign}. +* Ugly Implicit Argument Conversion:: Disabled via @option{-fno-ugly-args}. +* Ugly Assumed-Size Arrays:: Enabled via @option{-fugly-assumed}. +* Ugly Null Arguments:: Enabled via @option{-fugly-comma}. +* Ugly Complex Part Extraction:: Enabled via @option{-fugly-complex}. +* Ugly Conversion of Initializers:: Disabled via @option{-fno-ugly-init}. +* Ugly Integer Conversions:: Enabled via @option{-fugly-logint}. +* Ugly Assigned Labels:: Enabled via @option{-fugly-assign}. @end menu @node Ugly Implicit Argument Conversion @@ -4302,7 +4331,7 @@ extensions that just plain look ugly in the harsh light of day. @cindex Hollerith constants @cindex constants, Hollerith -The @samp{-fno-ugly-args} option disables +The @option{-fno-ugly-args} option disables passing typeless and Hollerith constants as actual arguments in procedure invocations. For example: @@ -4325,7 +4354,7 @@ Therefore, they are enabled by default. @cindex assumed-size arrays @cindex DIMENSION X(1) -The @samp{-fugly-assumed} option enables +The @option{-fugly-assumed} option enables the treatment of any array with a final dimension specified as @samp{1} as an assumed-size array, as if @samp{*} had been specified instead. @@ -4358,7 +4387,7 @@ arrays in the Fortran community. treated if @samp{X} is listed as a dummy argument only @emph{after} the @code{DIMENSION} statement (presumably in an @code{ENTRY} statement). -For example, @samp{-fugly-assumed} has no effect on the +For example, @option{-fugly-assumed} has no effect on the following program unit: @example @@ -4376,16 +4405,16 @@ END @cindex real part @cindex imaginary part -The @samp{-fugly-complex} option enables +The @option{-fugly-complex} option enables use of the @code{REAL()} and @code{AIMAG()} intrinsics with arguments that are @code{COMPLEX} types other than @code{COMPLEX(KIND=1)}. -With @samp{-ff90} in effect, these intrinsics return +With @option{-ff90} in effect, these intrinsics return the unconverted real and imaginary parts (respectively) of their argument. -With @samp{-fno-f90} in effect, these intrinsics convert +With @option{-fno-f90} in effect, these intrinsics convert the real and imaginary parts to @code{REAL(KIND=1)}, and return the result of that conversion. @@ -4401,10 +4430,10 @@ REAL(REAL(Z)) @noindent is permitted even when @samp{Z} is @code{COMPLEX(KIND=2)} -and @samp{-fno-ugly-complex} is in effect, because the +and @option{-fno-ugly-complex} is in effect, because the meaning is clear. -@code{g77} enforces this restriction, unless @samp{-fugly-complex} +@command{g77} enforces this restriction, unless @option{-fugly-complex} is specified, in which case the appropriate interpretation is chosen and no diagnostic is issued. @@ -4427,7 +4456,7 @@ without conversion. @cindex null arguments @cindex arguments, null -The @samp{-fugly-comma} option enables use of a single trailing comma +The @option{-fugly-comma} option enables use of a single trailing comma to mean ``pass an extra trailing null argument'' in a list of actual arguments to an external procedure, and use of an empty list of arguments to such a procedure @@ -4448,7 +4477,7 @@ that is syntactically distinct from passing no arguments. That is, this construct changes the meaning of code that makes no use of the construct. -So, with @samp{-fugly-comma} in force, @samp{CALL FOO()} +So, with @option{-fugly-comma} in force, @samp{CALL FOO()} and @samp{I = JFUNC()} pass a single null argument, instead of passing no arguments as required by the Fortran 77 and 90 standards. @@ -4459,16 +4488,16 @@ called procedure does not expect. So, in practice, there might be no difference in the behavior of a program that does @samp{CALL FOO()} -or @samp{I = JFUNC()} and is compiled with @samp{-fugly-comma} +or @samp{I = JFUNC()} and is compiled with @option{-fugly-comma} in force as compared to its behavior when compiled -with the default, @samp{-fno-ugly-comma}, in force, +with the default, @option{-fno-ugly-comma}, in force, assuming @samp{FOO} and @samp{JFUNC} do not expect any arguments to be passed. @node Ugly Conversion of Initializers @subsection Ugly Conversion of Initializers -The constructs disabled by @samp{-fno-ugly-init} are: +The constructs disabled by @option{-fno-ugly-init} are: @itemize @bullet @cindex Hollerith constants @@ -4480,7 +4509,7 @@ constants---that is, @code{DATA} and @code{PARAMETER} statements, plus type-declaration statements specifying initial values. Here are some sample initializations that are disabled by the -@samp{-fno-ugly-init} option: +@option{-fno-ugly-init} option: @example PARAMETER (VAL='9A304FFE'X) @@ -4495,7 +4524,7 @@ In the same contexts as above, use of character constants to initialize numeric items and vice versa (one constant per item). Here are more sample initializations that are disabled by the -@samp{-fno-ugly-init} option: +@option{-fno-ugly-init} option: @example INTEGER IA @@ -4513,7 +4542,7 @@ are treated as assignments to known types (the dummy arguments, in these cases). Here are sample statements that are disabled by the -@samp{-fno-ugly-init} option: +@option{-fno-ugly-init} option: @example IVAR = 4HABCD @@ -4530,7 +4559,7 @@ Therefore, they are enabled by default. @node Ugly Integer Conversions @subsection Ugly Integer Conversions -The constructs enabled via @samp{-fugly-logint} are: +The constructs enabled via @option{-fugly-logint} are: @itemize @bullet @item @@ -4565,7 +4594,7 @@ different encodings. @cindex assigned labels @cindex pointers -The @samp{-fugly-assign} option forces @code{g77} to use the +The @option{-fugly-assign} option forces @command{g77} to use the same storage for assigned labels as it would for a normal assignment to the same variable. @@ -4577,7 +4606,7 @@ ASSIGN 10 TO I @end example @noindent -Normally, for portability and improved diagnostics, @code{g77} +Normally, for portability and improved diagnostics, @command{g77} reserves distinct storage for a ``sibling'' of @samp{I}, used only for @code{ASSIGN} statements to that variable (along with the corresponding assigned-@code{GOTO} and assigned-@code{FORMAT}-I/O @@ -4596,26 +4625,26 @@ GOTO J @end example @noindent -Such code doesn't work under @code{g77} unless @samp{-fugly-assign} +Such code doesn't work under @command{g77} unless @option{-fugly-assign} is specified on the command-line, ensuring that the value of @code{I} -referenced in the second line is whatever value @code{g77} uses +referenced in the second line is whatever value @command{g77} uses to designate statement label @samp{10}, so the value may be copied into the @samp{ISTATE} array, later retrieved into a variable of the appropriate type (@samp{J}), and used as the target of an assigned-@code{GOTO} statement. @emph{Note:} To avoid subtle program bugs, -when @samp{-fugly-assign} is specified, -@code{g77} requires the type of variables +when @option{-fugly-assign} is specified, +@command{g77} requires the type of variables specified in assigned-label contexts @emph{must} be the same type returned by @code{%LOC()}. On many systems, this type is effectively the same as @code{INTEGER(KIND=1)}, while, on others, it is effectively the same as @code{INTEGER(KIND=2)}. -Do @emph{not} depend on @code{g77} actually writing valid pointers +Do @emph{not} depend on @command{g77} actually writing valid pointers to these variables, however. -While @code{g77} currently chooses that implementation, it might +While @command{g77} currently chooses that implementation, it might be changed in the future. @xref{Assigned Statement Labels,,Assigned Statement Labels (ASSIGN and GOTO)}, @@ -4624,10 +4653,10 @@ for implementation details on assigned-statement labels. @node Compiler @chapter The GNU Fortran Compiler -The GNU Fortran compiler, @code{g77}, supports programs written +The GNU Fortran compiler, @command{g77}, supports programs written in the GNU Fortran language and in some other dialects of Fortran. -Some aspects of how @code{g77} works are universal regardless +Some aspects of how @command{g77} works are universal regardless of dialect, and yet are not properly part of the GNU Fortran language itself. These are described below. @@ -4648,7 +4677,7 @@ of work!} @cindex limits, compiler @cindex compiler limits -@code{g77}, as with GNU tools in general, imposes few arbitrary restrictions +@command{g77}, as with GNU tools in general, imposes few arbitrary restrictions on lengths of identifiers, number of continuation lines, number of external symbols in a program, and so on. @@ -4659,13 +4688,13 @@ symbols in a program, and so on. @cindex limits, continuation lines @cindex limits, lengths of names For example, some other Fortran compiler have an option -(such as @samp{-Nl@var{x}}) to increase the limit on the +(such as @option{-Nl@var{x}}) to increase the limit on the number of continuation lines. Also, some Fortran compilation systems have an option -(such as @samp{-Nx@var{x}}) to increase the limit on the +(such as @option{-Nx@var{x}}) to increase the limit on the number of external symbols. -@code{g77}, @code{gcc}, and GNU @code{ld} (the GNU linker) have +@command{g77}, @command{gcc}, and GNU @code{ld} (the GNU linker) have no equivalent options, since they do not impose arbitrary limits in these areas. @@ -4675,7 +4704,7 @@ limits in these areas. @cindex maximum number of dimensions @cindex limits, rank @cindex limits, array dimensions -@code{g77} does currently limit the number of dimensions in an array +@command{g77} does currently limit the number of dimensions in an array to the same degree as do the Fortran standards---seven (7). This restriction might be lifted in a future version. @@ -4685,12 +4714,12 @@ This restriction might be lifted in a future version. @cindex wraparound As a portable Fortran implementation, -@code{g77} offers its users direct access to, +@command{g77} offers its users direct access to, and otherwise depends upon, the underlying facilities of the system -used to build @code{g77}, -the system on which @code{g77} itself is used to compile programs, -and the system on which the @code{g77}-compiled program is actually run. +used to build @command{g77}, +the system on which @command{g77} itself is used to compile programs, +and the system on which the @command{g77}-compiled program is actually run. (For most users, the three systems are of the same type---combination of operating environment and hardware---often the same physical system.) @@ -4702,12 +4731,12 @@ These limits vary from system to system. Even when such limits might be well beyond the possibility of being encountered on a particular system, -the @code{g77} run-time environment +the @command{g77} run-time environment has certain built-in limits, usually, but not always, stemming from intrinsics with inherently limited interfaces. -Currently, the @code{g77} run-time environment +Currently, the @command{g77} run-time environment does not generally offer a less-limiting environment by augmenting the underlying system's own environment. @@ -4718,8 +4747,8 @@ about the run-time environment---assumptions that prove to be false for some particular environments. The GNU Fortran language, -the @code{g77} compiler and run-time environment, -and the @code{g77} documentation +the @command{g77} compiler and run-time environment, +and the @command{g77} documentation do not yet offer comprehensive portable work-arounds for such limits, though programmers should be able to find their own in specific instances. @@ -4773,7 +4802,7 @@ on at least some systems: @cindex Y2K compliance @cindex Year 2000 compliance -While the @code{g77} compiler itself is believed to +While the @command{g77} compiler itself is believed to be Year-2000 (Y2K) compliant, some intrinsics are not, and, potentially, some underlying systems are not, @@ -4807,7 +4836,7 @@ on at least some systems: @cindex G77_date_y2kbuggy_0 @cindex G77_vxtidate_y2kbuggy_0 The @code{libg2c} library -shipped with any @code{g77} that warns +shipped with any @command{g77} that warns about invocation of a non-Y2K-compliant intrinsic has renamed the @code{EXTERNAL} procedure names of those intrinsics. @@ -4836,14 +4865,14 @@ CALL VXTIDATE_Y2KBUG (MM, DD, YY) (Note that the @code{EXTERNAL} statement is not actually required, since the modified names are not recognized as intrinsics -by the current version of @code{g77}. +by the current version of @command{g77}. But it is shown in this specific case, for purposes of illustration.) The renaming of @code{EXTERNAL} procedure names of these intrinsics causes unresolved references at link time. For example, @samp{EXTERNAL DATE; CALL DATE(STR)} -is normally compiled by @code{g77} +is normally compiled by @command{g77} as, in C, @samp{date_(&str, 20);}. This, in turn, links to the @code{date_} procedure in the @code{libE77} portion of @code{libg2c}, @@ -4851,13 +4880,13 @@ which purposely calls a nonexistent procedure named @code{G77_date_y2kbuggy_0}. The resulting link-time error is designed, via this name, to encourage the programmer to look up the -index entries to this portion of the @code{g77} documentation. +index entries to this portion of the @command{g77} documentation. Generally, we recommend that the @code{EXTERNAL} method of invoking procedures in @code{libg2c} @emph{not} be used. When used, some of the correctness checking -normally performed by @code{g77} +normally performed by @command{g77} is skipped. In particular, it is probably better to use the @@ -4865,23 +4894,23 @@ In particular, it is probably better to use the non-Y2K-compliant procedures, so anyone compiling the code can quickly notice the potential Y2K problems -(via the warnings printing by @code{g77}) +(via the warnings printing by @command{g77}) without having to even look at the code itself. If there are problems linking @code{libg2c} -to code compiled by @code{g77} +to code compiled by @command{g77} that involve the string @samp{y2kbug}, and these are not explained above, that probably indicates that a version of @code{libg2c} -older than @code{g77} +older than @command{g77} is being linked to, or that the new library is being linked -to code compiled by an older version of @code{g77}. +to code compiled by an older version of @command{g77}. That's because, as of the version that warns about non-Y2K-compliant intrinsic invocation, -@code{g77} references the @code{libg2c} implementations +@command{g77} references the @code{libg2c} implementations of those intrinsics using new names, containing the string @samp{y2kbug}. @@ -4899,7 +4928,7 @@ to @code{G77_vxtidate_0}. (The new library calls it @code{G77_vxtidate_y2kbug_0}.) The proper fix for the above problems -is to obtain the latest release of @code{g77} +is to obtain the latest release of @command{g77} and related products (including @code{libg2c}) and install them on all systems, @@ -4912,19 +4941,19 @@ In this case, however, it seems more important to highlight potential Y2K problems than to ease the transition of potentially non-Y2K-compliant code -to new versions of @code{g77} and @code{libg2c}.) +to new versions of @command{g77} and @code{libg2c}.) @node Array Size @subsection Array Size @cindex limits, array size @cindex array size -Currently, @code{g77} uses the default @code{INTEGER} type +Currently, @command{g77} uses the default @code{INTEGER} type for array indexes, which limits the sizes of single-dimension arrays on systems offering a larger address space than can be addressed by that type. -(That @code{g77} puts all arrays in memory +(That @command{g77} puts all arrays in memory could be considered another limitation---it could use large temporary files---but that decision is left to the programmer as an implementation choice @@ -4949,22 +4978,22 @@ on the same system. @cindex multi-dimension arrays @cindex arrays, dimensioning Whether large multiple-dimension arrays are reliably supported -depends mostly on the @code{gcc} back end (code generator) -used by @code{g77}, and has not yet been fully investigated. +depends mostly on the @command{gcc} back end (code generator) +used by @command{g77}, and has not yet been fully investigated. @node Character-variable Length @subsection Character-variable Length @cindex limits, on character-variable length @cindex character-variable length -Currently, @code{g77} uses the default @code{INTEGER} type +Currently, @command{g77} uses the default @code{INTEGER} type for the lengths of @code{CHARACTER} variables and array elements. This means that, for example, a system with a 64-bit address space and a 32-bit default @code{INTEGER} type -does not, under @code{g77}, +does not, under @command{g77}, support a @code{CHARACTER*@var{n}} declaration where @var{n} is greater than 2147483647. @@ -5011,7 +5040,7 @@ element of the @code{COMPLEX(KIND=1)} variable. placed on the implementation, nor is the relationship of storage sizes of these types to the @code{CHARACTER} type specified, by the standard.) -@code{g77} follows the above requirements, warning when compiling +@command{g77} follows the above requirements, warning when compiling a program requires placement of items in memory that contradict the requirements of the target architecture. (For example, a program can require placement of a @code{REAL(KIND=2)} @@ -5021,22 +5050,22 @@ On some target architectures, using the canonical mapping of Fortran types to underlying architectural types, such placement is prohibited by the machine definition or the Application Binary Interface (ABI) in force for -the configuration defined for building @code{gcc} and @code{g77}. -@code{g77} warns about such +the configuration defined for building @command{gcc} and @command{g77}. +@command{g77} warns about such situations when it encounters them.) -@code{g77} follows consistent rules for configuring the mapping between Fortran +@command{g77} follows consistent rules for configuring the mapping between Fortran types, including the @samp{*@var{n}} notation, and the underlying architectural types as accessed by a similarly-configured applicable version of the -@code{gcc} compiler. +@command{gcc} compiler. These rules offer a widely portable, consistent Fortran/C environment, although they might well conflict with the expectations of users of Fortran compilers designed and written for particular architectures. These rules are based on the configuration that is in force for the -version of @code{gcc} built in the same release as @code{g77} (and -which was therefore used to build both the @code{g77} compiler +version of @command{gcc} built in the same release as @command{g77} (and +which was therefore used to build both the @command{g77} compiler components and the @code{libg2c} run-time library): @table @code @@ -5061,7 +5090,7 @@ an @code{int} or a @code{long int}. @cindex LOGICAL(KIND=1) type @cindex types, LOGICAL(KIND=1) @item LOGICAL(KIND=1) -Same @code{gcc} type as @code{INTEGER(KIND=1)}. +Same @command{gcc} type as @code{INTEGER(KIND=1)}. @cindex INTEGER(KIND=2) type @cindex types, INTEGER(KIND=2) @@ -5073,17 +5102,17 @@ a @code{long int} or a @code{long long int}. @cindex LOGICAL(KIND=2) type @cindex types, LOGICAL(KIND=2) @item LOGICAL(KIND=2) -Same @code{gcc} type as @code{INTEGER(KIND=2)}. +Same @command{gcc} type as @code{INTEGER(KIND=2)}. @cindex INTEGER(KIND=3) type @cindex types, INTEGER(KIND=3) @item INTEGER(KIND=3) -Same @code{gcc} type as signed @code{char}. +Same @command{gcc} type as signed @code{char}. @cindex LOGICAL(KIND=3) type @cindex types, LOGICAL(KIND=3) @item LOGICAL(KIND=3) -Same @code{gcc} type as @code{INTEGER(KIND=3)}. +Same @command{gcc} type as @code{INTEGER(KIND=3)}. @cindex INTEGER(KIND=6) type @cindex types, INTEGER(KIND=6) @@ -5095,7 +5124,7 @@ a @code{short}. @cindex LOGICAL(KIND=6) type @cindex types, LOGICAL(KIND=6) @item LOGICAL(KIND=6) -Same @code{gcc} type as @code{INTEGER(KIND=6)}. +Same @command{gcc} type as @code{INTEGER(KIND=6)}. @cindex COMPLEX(KIND=1) type @cindex types, COMPLEX(KIND=1) @@ -5111,8 +5140,8 @@ Two @code{REAL(KIND=2)} scalars. @cindex *@var{n} notation @item @var{numeric-type}*@var{n} (Where @var{numeric-type} is any type other than @code{CHARACTER}.) -Same as whatever @code{gcc} type occupies @var{n} times the storage -space of a @code{gcc} @code{char} item. +Same as whatever @command{gcc} type occupies @var{n} times the storage +space of a @command{gcc} @code{char} item. @cindex DOUBLE PRECISION type @cindex types, DOUBLE PRECISION @@ -5126,14 +5155,14 @@ Same as @code{COMPLEX(KIND=2)}. @end table Note that the above are proposed correspondences and might change -in future versions of @code{g77}---avoid writing code depending +in future versions of @command{g77}---avoid writing code depending on them. -Other types supported by @code{g77} +Other types supported by @command{g77} are derived from gcc types such as @code{char}, @code{short}, @code{int}, @code{long int}, @code{long long int}, @code{long double}, and so on. -That is, whatever types @code{gcc} already supports, @code{g77} supports +That is, whatever types @command{gcc} already supports, @command{g77} supports now or probably will support in a future version. The rules for the @samp{@var{numeric-type}*@var{n}} notation apply to these types, @@ -5145,7 +5174,7 @@ assigned in a way that encourages clarity, consistency, and portability. @cindex constants @cindex types, constants -@code{g77} strictly assigns types to @emph{all} constants not +@command{g77} strictly assigns types to @emph{all} constants not documented as ``typeless'' (typeless constants including @samp{'1'Z}, for example). Many other Fortran compilers attempt to assign types to typed constants @@ -5154,9 +5183,9 @@ This results in hard-to-find bugs, nonportable code, and is not in the spirit (though it strictly follows the letter) of the 77 and 90 standards. -@code{g77} might offer, in a future release, explicit constructs by +@command{g77} might offer, in a future release, explicit constructs by which a wider variety of typeless constants may be specified, and/or -user-requested warnings indicating places where @code{g77} might differ +user-requested warnings indicating places where @command{g77} might differ from how other compilers assign types to constants. @xref{Context-Sensitive Constants}, for more information on this issue. @@ -5164,7 +5193,7 @@ from how other compilers assign types to constants. @node Compiler Intrinsics @section Compiler Intrinsics -@code{g77} offers an ever-widening set of intrinsics. +@command{g77} offers an ever-widening set of intrinsics. Currently these all are procedures (functions and subroutines). Some of these intrinsics are unimplemented, but their names reserved @@ -5173,7 +5202,7 @@ Others are implemented as part of the GNU Fortran language, while yet others are provided for compatibility with other dialects of Fortran but are not part of the GNU Fortran language. -To manage these distinctions, @code{g77} provides intrinsic @emph{groups}, +To manage these distinctions, @command{g77} provides intrinsic @emph{groups}, a facility that is simply an extension of the intrinsic groups provided by the GNU Fortran language. @@ -5244,8 +5273,8 @@ EXTERNAL FOO @end example @noindent -So, deleting a group tells @code{g77} to pretend as though the intrinsics in -that group do not exist at all, whereas disabling it tells @code{g77} to +So, deleting a group tells @command{g77} to pretend as though the intrinsics in +that group do not exist at all, whereas disabling it tells @command{g77} to recognize them as (disabled) intrinsics in intrinsic-like contexts. Hiding a group is like enabling it, but the intrinsic must be first @@ -5284,9 +5313,9 @@ have intended side effects). Intrinsics the GNU Fortran language supports that are extensions to the Fortran standards (77 and 90). -@cindex @code{f2c} intrinsics group +@cindex @command{f2c} intrinsics group @item f2c -Intrinsics supported by AT&T's @code{f2c} converter and/or @code{libf2c}. +Intrinsics supported by AT&T's @command{f2c} converter and/or @code{libf2c}. @cindex @code{f90} intrinsics group @item f90 @@ -5310,7 +5339,7 @@ VAX/VMS FORTRAN (current as of v4) intrinsics. @cindex intrinsics, others @cindex other intrinsics -@code{g77} supports intrinsics other than those in the GNU Fortran +@command{g77} supports intrinsics other than those in the GNU Fortran language proper. This set of intrinsics is described below. @@ -5365,30 +5394,30 @@ like how to pass parameters, return arguments, and lay out incorrect results produced by the program (and that assumes these errors are detected, which is not always the case). -Normally, @code{g77} generates code that is +Normally, @command{g77} generates code that is object-compatible with code generated by a version of -@code{f2c} configured (with, for example, @file{f2c.h} definitions) -to be generally compatible with @code{g77} as built by @code{gcc}. -(Normally, @code{f2c} will, by default, conform to the appropriate +@command{f2c} configured (with, for example, @file{f2c.h} definitions) +to be generally compatible with @command{g77} as built by @command{gcc}. +(Normally, @command{f2c} will, by default, conform to the appropriate configuration, but it is possible that older or perhaps even newer -versions of @code{f2c}, or versions having certain configuration changes -to @code{f2c} internals, will produce object files that are -incompatible with @code{g77}.) +versions of @command{f2c}, or versions having certain configuration changes +to @command{f2c} internals, will produce object files that are +incompatible with @command{g77}.) For example, a Fortran string subroutine argument will become two arguments on the C side: a @code{char *} and an @code{int} length. Much of this compatibility results from the fact that -@code{g77} uses the same run-time library, -@code{libf2c}, used by @code{f2c}, -though @code{g77} gives its version the name @code{libg2c} +@command{g77} uses the same run-time library, +@code{libf2c}, used by @command{f2c}, +though @command{g77} gives its version the name @code{libg2c} so as to avoid conflicts when linking, installing them in the same directories, and so on. Other compilers might or might not generate code that -is object-compatible with @code{libg2c} and current @code{g77}, +is object-compatible with @code{libg2c} and current @command{g77}, and some might offer such compatibility only when explicitly selected via a command-line option to the compiler. @@ -5401,78 +5430,78 @@ of work!} @end menu @node Dropping f2c Compatibility -@section Dropping @code{f2c} Compatibility +@section Dropping @command{f2c} Compatibility -Specifying @samp{-fno-f2c} allows @code{g77} to generate, in +Specifying @option{-fno-f2c} allows @command{g77} to generate, in some cases, faster code, by not needing to allow to the possibility -of linking with code compiled by @code{f2c}. +of linking with code compiled by @command{f2c}. For example, this affects how @code{REAL(KIND=1)}, @code{COMPLEX(KIND=1)}, and @code{COMPLEX(KIND=2)} functions are called. -With @samp{-fno-f2c}, they are -compiled as returning the appropriate @code{gcc} type +With @option{-fno-f2c}, they are +compiled as returning the appropriate @command{gcc} type (@code{float}, @code{__complex__ float}, @code{__complex__ double}, in many configurations). -With @samp{-ff2c} in force, they +With @option{-ff2c} in force, they are compiled differently (with perhaps slower run-time performance) -to accommodate the restrictions inherent in @code{f2c}'s use of K&R +to accommodate the restrictions inherent in @command{f2c}'s use of K&R C as an intermediate language---@code{REAL(KIND=1)} functions return C's @code{double} type, while @code{COMPLEX} functions return @code{void} and use an extra argument pointing to a place for the functions to return their values. -It is possible that, in some cases, leaving @samp{-ff2c} in force -might produce faster code than using @samp{-fno-f2c}. +It is possible that, in some cases, leaving @option{-ff2c} in force +might produce faster code than using @option{-fno-f2c}. Feel free to experiment, but remember to experiment with changing the way @emph{entire programs and their Fortran libraries are compiled} at a time, since this sort of experimentation affects the interface of code generated for a Fortran source file---that is, it affects object compatibility. -Note that @code{f2c} compatibility is a fairly static target to achieve, -though not necessarily perfectly so, since, like @code{g77}, it is +Note that @command{f2c} compatibility is a fairly static target to achieve, +though not necessarily perfectly so, since, like @command{g77}, it is still being improved. -However, specifying @samp{-fno-f2c} causes @code{g77} +However, specifying @option{-fno-f2c} causes @command{g77} to generate code that will probably be incompatible with code -generated by future versions of @code{g77} when the same option +generated by future versions of @command{g77} when the same option is in force. You should make sure you are always able to recompile complete -programs from source code when upgrading to new versions of @code{g77} -or @code{f2c}, especially when using options such as @samp{-fno-f2c}. +programs from source code when upgrading to new versions of @command{g77} +or @command{f2c}, especially when using options such as @option{-fno-f2c}. -Therefore, if you are using @code{g77} to compile libraries and other +Therefore, if you are using @command{g77} to compile libraries and other object files for possible future use and you don't want to require -recompilation for future use with subsequent versions of @code{g77}, -you might want to stick with @code{f2c} compatibility for now, and +recompilation for future use with subsequent versions of @command{g77}, +you might want to stick with @command{f2c} compatibility for now, and carefully watch for any announcements about changes to the -@code{f2c}/@code{libf2c} interface that might affect existing programs +@command{f2c}/@code{libf2c} interface that might affect existing programs (thus requiring recompilation). -It is probable that a future version of @code{g77} will not, -by default, generate object files compatible with @code{f2c}, +It is probable that a future version of @command{g77} will not, +by default, generate object files compatible with @command{f2c}, and that version probably would no longer use @code{libf2c}. If you expect to depend on this compatibility in the long term, use the options @samp{-ff2c -ff2c-library} when compiling all of the applicable code. -This should cause future versions of @code{g77} either to produce +This should cause future versions of @command{g77} either to produce compatible code (at the expense of the availability of some features and performance), or at the very least, to produce diagnostics. -(The library @code{g77} produces will no longer be named @file{libg2c} +(The library @command{g77} produces will no longer be named @file{libg2c} when it is no longer generally compatible with @file{libf2c}. It will likely be referred to, and, if installed as a distinct library, named @code{libg77}, or some other as-yet-unused name.) @node Compilers Other Than f2c -@section Compilers Other Than @code{f2c} +@section Compilers Other Than @command{f2c} -On systems with Fortran compilers other than @code{f2c} and @code{g77}, -code compiled by @code{g77} is not expected to work +On systems with Fortran compilers other than @command{f2c} and @command{g77}, +code compiled by @command{g77} is not expected to work well with code compiled by the native compiler. -(This is true for @code{f2c}-compiled objects as well.) +(This is true for @command{f2c}-compiled objects as well.) Libraries compiled with the native compiler probably will have -to be recompiled with @code{g77} to be used with @code{g77}-compiled code. +to be recompiled with @command{g77} to be used with @command{g77}-compiled code. Reasons for such incompatibilities include: @@ -5481,7 +5510,7 @@ Reasons for such incompatibilities include: There might be differences in the way names of Fortran procedures are translated for use in the system's object-file format. For example, the statement @samp{CALL FOO} might be compiled -by @code{g77} to call a procedure the linker @code{ld} sees +by @command{g77} to call a procedure the linker @code{ld} sees given the name @samp{_foo_}, while the apparently corresponding statement @samp{SUBROUTINE FOO} might be compiled by the native compiler to define the linker-visible name @samp{_foo}, @@ -5491,7 +5520,7 @@ or @samp{_FOO_}, and so on. There might be subtle type mismatches which cause subroutine arguments and function return values to get corrupted. -This is why simply getting @code{g77} to +This is why simply getting @command{g77} to transform procedure names the same way a native compiler does is not usually a good idea---unless some effort has been made to ensure that, aside @@ -5526,8 +5555,8 @@ of work!} @cindex C, linking with @cindex C++, linking with @cindex linking with C -The following discussion assumes that you are running @code{g77} in @code{f2c} -compatibility mode, i.e.@: not using @samp{-fno-f2c}. +The following discussion assumes that you are running @command{g77} in @command{f2c} +compatibility mode, i.e.@: not using @option{-fno-f2c}. It provides some advice about quick and simple techniques for linking Fortran and C (or C++), the most common requirement. @@ -5535,15 +5564,15 @@ For the full story consult the description of code generation. @xref{Debugging and Interfacing}. -When linking Fortran and C, it's usually best to use @code{g77} to do +When linking Fortran and C, it's usually best to use @command{g77} to do the linking so that the correct libraries are included (including the maths one). If you're linking with C++ you will want to add -@samp{-lstdc++}, @samp{-lg++} or whatever. +@option{-lstdc++}, @option{-lg++} or whatever. If you need to use another driver program (or @code{ld} directly), you can find out what linkage -options @code{g77} passes by running @samp{g77 -v}. +options @command{g77} passes by running @samp{g77 -v}. @menu * C Interfacing Tools:: @@ -5558,60 +5587,60 @@ options @code{g77} passes by running @samp{g77 -v}. @pindex f2c @cindex cfortran.h @cindex Netlib -Even if you don't actually use it as a compiler, @code{f2c} from +Even if you don't actually use it as a compiler, @command{f2c} from @uref{ftp://ftp.netlib.org/f2c/src}, can be a useful tool when you're interfacing (linking) Fortran and C@. -@xref{f2c Skeletons and Prototypes,,Generating Skeletons and Prototypes with @code{f2c}}. +@xref{f2c Skeletons and Prototypes,,Generating Skeletons and Prototypes with @command{f2c}}. -To use @code{f2c} for this purpose you only need retrieve and +To use @command{f2c} for this purpose you only need retrieve and build the @file{src} directory from the distribution, consult the @file{README} instructions there for machine-specifics, and install the -@code{f2c} program on your path. +@command{f2c} program on your path. Something else that might be useful is @samp{cfortran.h} from @uref{ftp://zebra.desy.de/cfortran}. This is a fairly general tool which can be used to generate interfaces for calling in both directions between Fortran and C@. -It can be used in @code{f2c} mode with -@code{g77}---consult its documentation for details. +It can be used in @command{f2c} mode with +@command{g77}---consult its documentation for details. @node C Access to Type Information @subsection Accessing Type Information in C @cindex types, Fortran/C Generally, C code written to link with -@code{g77} code---calling and/or being +@command{g77} code---calling and/or being called from Fortran---should @samp{#include <g2c.h>} to define the C versions of the Fortran types. Don't assume Fortran @code{INTEGER} types correspond to C @code{int}s, for instance; instead, declare them as @code{integer}, a type defined by @file{g2c.h}. -@file{g2c.h} is installed where @code{gcc} will find it by -default, assuming you use a copy of @code{gcc} compatible with -@code{g77}, probably built at the same time as @code{g77}. +@file{g2c.h} is installed where @command{gcc} will find it by +default, assuming you use a copy of @command{gcc} compatible with +@command{g77}, probably built at the same time as @command{g77}. @node f2c Skeletons and Prototypes -@subsection Generating Skeletons and Prototypes with @code{f2c} +@subsection Generating Skeletons and Prototypes with @command{f2c} @pindex f2c @cindex -fno-second-underscore -A simple and foolproof way to write @code{g77}-callable C routines---e.g.@: to +A simple and foolproof way to write @command{g77}-callable C routines---e.g.@: to interface with an existing library---is to write a file (named, for example, @file{fred.f}) of dummy Fortran skeletons comprising just the declaration of the routine(s) and dummy arguments plus @code{END} statements. -Then run @code{f2c} on file @file{fred.f} to produce @file{fred.c} +Then run @command{f2c} on file @file{fred.f} to produce @file{fred.c} into which you can edit useful code, confident the calling sequence is correct, at least. (There are some errors otherwise commonly made in generating C -interfaces with @code{f2c} conventions, +interfaces with @command{f2c} conventions, such as not using @code{doublereal} as the return type of a @code{REAL} @code{FUNCTION}.) @pindex ftnchek -@code{f2c} also can help with calling Fortran from C, using its -@samp{-P} option to generate C prototypes appropriate for calling the +@command{f2c} also can help with calling Fortran from C, using its +@option{-P} option to generate C prototypes appropriate for calling the Fortran.@footnote{The files generated like this can also be used for inter-unit consistency checking of dummy and actual arguments, although the @code{ftnchek} tool from @uref{ftp://ftp.netlib.org/fortran} @@ -5625,20 +5654,20 @@ prototype information. the Fortran routines to make sure you get it right. @xref{Arrays,,Arrays (DIMENSION)}, for information on the differences -between the way Fortran (including compilers like @code{g77}) and +between the way Fortran (including compilers like @command{g77}) and C handle arrays. @node C++ Considerations @subsection C++ Considerations @cindex C++ -@code{f2c} can be used to generate suitable code for compilation with a -C++ system using the @samp{-C++} option. -The important thing about linking @code{g77}-compiled -code with C++ is that the prototypes for the @code{g77} +@command{f2c} can be used to generate suitable code for compilation with a +C++ system using the @option{-C++} option. +The important thing about linking @command{g77}-compiled +code with C++ is that the prototypes for the @command{g77} routines must specify C linkage to avoid name mangling. So, use an @samp{extern "C"} declaration. -@code{f2c}'s @samp{-C++} option will take care +@command{f2c}'s @option{-C++} option will take care of this when generating skeletons or prototype files as above, and also avoid clashes with C++ reserved words in addition to those in C@. @@ -5654,17 +5683,17 @@ it shouldn't be necessary to use a Fortran main program unit to ensure the runtime---specifically the I/O system---is initialized. -However, to use the @code{g77} intrinsics @code{GETARG} and @code{IARGC}, +However, to use the @command{g77} intrinsics @code{GETARG} and @code{IARGC}, either the @code{main} routine from the @file{libg2c} library must be used, or the @code{f_setarg} routine -(new as of @code{egcs} version 1.1 and @code{g77} version 0.5.23) +(new as of @code{egcs} version 1.1 and @command{g77} version 0.5.23) must be called with the appropriate @code{argc} and @code{argv} arguments prior to the program calling @code{GETARG} or @code{IARGC}. To provide more flexibility for mixed-language programming -involving @code{g77} while allowing for shared libraries, -as of @code{egcs} version 1.1 and @code{g77} version 0.5.23, -@code{g77}'s @code{main} routine in @code{libg2c} +involving @command{g77} while allowing for shared libraries, +as of @code{egcs} version 1.1 and @command{g77} version 0.5.23, +@command{g77}'s @code{main} routine in @code{libg2c} does the following, in order: @enumerate @@ -5690,7 +5719,7 @@ as all I/O functions in @code{libf2c} are believed to call @code{f_init} automatically, if necessary. -(A future version of @code{g77} might skip this explicit step, +(A future version of @command{g77} might skip this explicit step, to speed up normal exit of a program.) @item @@ -5722,7 +5751,7 @@ Calls @code{MAIN__} (with no arguments). This starts executing the Fortran main program unit for the application. -(Both @code{g77} and @code{f2c} currently compile a main +(Both @command{g77} and @command{f2c} currently compile a main program unit so that its global name is @code{MAIN__}.) @item @@ -5742,7 +5771,7 @@ in case @code{exit} doesn't exit on the system. All of the above names are C @code{extern} names, i.e.@: not mangled. -When using the @code{main} procedure provided by @code{g77} +When using the @code{main} procedure provided by @command{g77} without a Fortran main program unit, you need to provide @code{MAIN__} as the entry point for your C code. @@ -5750,15 +5779,15 @@ as the entry point for your C code. entry point with the rest of your program.) To provide your own @code{main} procedure -in place of @code{g77}'s, +in place of @command{g77}'s, make sure you specify the object file defining that procedure -@emph{before} @samp{-lg2c} on the @code{g77} command line. -Since the @samp{-lg2c} option is implicitly provided, +@emph{before} @option{-lg2c} on the @command{g77} command line. +Since the @option{-lg2c} option is implicitly provided, this is usually straightforward. -(Use the @samp{--verbose} option to see how and where -@code{g77} implicitly adds @samp{-lg2c} in a command line +(Use the @option{--verbose} option to see how and where +@command{g77} implicitly adds @option{-lg2c} in a command line that will link the program. -Feel free to specify @samp{-lg2c} explicitly, +Feel free to specify @option{-lg2c} explicitly, as appropriate.) However, when providing your own @code{main}, @@ -5775,20 +5804,20 @@ some scratch files might be left lying around, and some existing files being written might be left with old data not properly truncated at the end. -Note that, generally, the @code{g77} operating environment +Note that, generally, the @command{g77} operating environment does not depend on a procedure named @code{MAIN__} actually -being called prior to any other @code{g77}-compiled code. +being called prior to any other @command{g77}-compiled code. That is, @code{MAIN__} does not, itself, set up any important operating-environment characteristics upon which other code might depend. -This might change in future versions of @code{g77}, +This might change in future versions of @command{g77}, with appropriate notification in the release notes. For more information, consult the source code for the above routines. These are in @file{@value{path-libf2c}/libF77/}, named @file{main.c}, @file{setarg.c}, @file{setsig.c}, @file{getarg_.c}, and @file{iargc_.c}. -Also, the file @file{@value{path-g77}/com.c} contains the code @code{g77} +Also, the file @file{@value{path-g77}/com.c} contains the code @command{g77} uses to open-code (inline) references to @code{IARGC}. @node Debugging and Interfacing @@ -5800,7 +5829,7 @@ uses to open-code (inline) references to @code{IARGC}. @cindex f2c compatibility GNU Fortran currently generates code that is object-compatible with -the @code{f2c} converter. +the @command{f2c} converter. Also, it avoids limitations in the current GBE, such as the inability to generate a procedure with multiple entry points, by generating code that is structured @@ -5808,47 +5837,47 @@ differently (in terms of procedure names, scopes, arguments, and so on) than might be expected. As a result, writing code in other languages that calls on, is -called by, or shares in-memory data with @code{g77}-compiled code generally -requires some understanding of the way @code{g77} compiles code for +called by, or shares in-memory data with @command{g77}-compiled code generally +requires some understanding of the way @command{g77} compiles code for various constructs. -Similarly, using a debugger to debug @code{g77}-compiled +Similarly, using a debugger to debug @command{g77}-compiled code, even if that debugger supports native Fortran debugging, generally requires this sort of information. This section describes some of the basic information on how -@code{g77} compiles code for constructs involving interfaces to other +@command{g77} compiles code for constructs involving interfaces to other languages and to debuggers. @emph{Caution:} Much or all of this information pertains to only the current -release of @code{g77}, sometimes even to using certain compiler options -with @code{g77} (such as @samp{-fno-f2c}). +release of @command{g77}, sometimes even to using certain compiler options +with @command{g77} (such as @option{-fno-f2c}). Do not write code that depends on this information without clearly marking said code as nonportable and -subject to review for every new release of @code{g77}. +subject to review for every new release of @command{g77}. This information is provided primarily to make debugging of code generated by this -particular release of @code{g77} easier for the user, and partly to make +particular release of @command{g77} easier for the user, and partly to make writing (generally nonportable) interface code easier. Both of these -activities require tracking changes in new version of @code{g77} as they +activities require tracking changes in new version of @command{g77} as they are installed, because new versions can change the behaviors described in this section. @menu -* Main Program Unit:: How @code{g77} compiles a main program unit. -* Procedures:: How @code{g77} constructs parameter lists +* Main Program Unit:: How @command{g77} compiles a main program unit. +* Procedures:: How @command{g77} constructs parameter lists for procedures. * Functions:: Functions returning floating-point or character data. * Names:: Naming of user-defined variables, procedures, etc. * Common Blocks:: Accessing common variables while debugging. * Local Equivalence Areas:: Accessing @code{EQUIVALENCE} while debugging. -* Complex Variables:: How @code{g77} performs complex arithmetic. +* Complex Variables:: How @command{g77} performs complex arithmetic. * Arrays:: Dealing with (possibly multi-dimensional) arrays. * Adjustable Arrays:: Special consideration for adjustable arrays. -* Alternate Entry Points:: How @code{g77} implements alternate @code{ENTRY}. -* Alternate Returns:: How @code{g77} handles alternate returns. -* Assigned Statement Labels:: How @code{g77} handles @code{ASSIGN}. +* Alternate Entry Points:: How @command{g77} implements alternate @code{ENTRY}. +* Alternate Returns:: How @command{g77} handles alternate returns. +* Assigned Statement Labels:: How @command{g77} handles @code{ASSIGN}. * Run-time Library Errors:: Meanings of some @code{IOSTAT=} values. @end menu @@ -5857,22 +5886,22 @@ described in this section. @cindex PROGRAM statement @cindex statements, PROGRAM -When @code{g77} compiles a main program unit, it gives it the public +When @command{g77} compiles a main program unit, it gives it the public procedure name @code{MAIN__}. The @code{libg2c} library has the actual @code{main()} procedure as is typical of C-based environments, and it is this procedure that performs some initial start-up activity and then calls @code{MAIN__}. -Generally, @code{g77} and @code{libg2c} are designed so that you need not +Generally, @command{g77} and @code{libg2c} are designed so that you need not include a main program unit written in Fortran in your program---it can be written in C or some other language. -Especially for I/O handling, this is the case, although @code{g77} version 0.5.16 +Especially for I/O handling, this is the case, although @command{g77} version 0.5.16 includes a bug fix for @code{libg2c} that solved a problem with using the @code{OPEN} statement as the first Fortran I/O activity in a program without a Fortran main program unit. -However, if you don't intend to use @code{g77} (or @code{f2c}) to compile +However, if you don't intend to use @command{g77} (or @command{f2c}) to compile your main program unit---that is, if you intend to compile a @code{main()} procedure using some other language---you should carefully examine the code for @code{main()} in @code{libg2c}, found in the source @@ -5933,14 +5962,14 @@ that should work fine. @cindex statements, FUNCTION @cindex signature of procedures -Currently, @code{g77} passes arguments via reference---specifically, +Currently, @command{g77} passes arguments via reference---specifically, by passing a pointer to the location in memory of a variable, array, array element, a temporary location that holds the result of evaluating an expression, or a temporary or permanent location that holds the value of a constant. Procedures that accept @code{CHARACTER} arguments are implemented by -@code{g77} so that each @code{CHARACTER} argument has two actual arguments. +@command{g77} so that each @code{CHARACTER} argument has two actual arguments. The first argument occupies the expected position in the argument list and has the user-specified name. @@ -5969,9 +5998,9 @@ When more than one @code{CHARACTER} argument is present in the argument list, the length arguments are appended in the order the original arguments appear. So @samp{CALL FOO('HI','THERE')} is implemented in -C as @samp{foo("hi","there",2,5);}, ignoring the fact that @code{g77} +C as @samp{foo("hi","there",2,5);}, ignoring the fact that @command{g77} does not provide the trailing null bytes on the constant -strings (@code{f2c} does provide them, but they are unnecessary in +strings (@command{f2c} does provide them, but they are unnecessary in a Fortran environment, and you should not expect them to be there). @@ -6010,7 +6039,7 @@ symptoms might appear. @cindex statements, RETURN @cindex return type of functions -@code{g77} handles in a special way functions that return the following +@command{g77} handles in a special way functions that return the following types: @itemize @bullet @@ -6022,7 +6051,7 @@ types: @code{REAL(KIND=1)} @end itemize -For @code{CHARACTER}, @code{g77} implements a subroutine (a C function +For @code{CHARACTER}, @command{g77} implements a subroutine (a C function returning @code{void}) with two arguments prepended: @samp{__g77_result}, which the caller passes as a pointer to a @code{char} array expected to hold the return value, @@ -6033,22 +6062,22 @@ For @code{CHARACTER*(*)}, the called function uses @samp{__g77_length} to determine the size of the array that @samp{__g77_result} points to; otherwise, it ignores that argument. -For @code{COMPLEX}, when @samp{-ff2c} is in -force, @code{g77} implements +For @code{COMPLEX}, when @option{-ff2c} is in +force, @command{g77} implements a subroutine with one argument prepended: @samp{__g77_result}, which the caller passes as a pointer to a variable of the type of the function. The called function writes the return value into this variable instead of returning it as a function value. -When @samp{-fno-f2c} is in force, -@code{g77} implements a @code{COMPLEX} function as @code{gcc}'s +When @option{-fno-f2c} is in force, +@command{g77} implements a @code{COMPLEX} function as @command{gcc}'s @samp{__complex__ float} or @samp{__complex__ double} function -(or an emulation thereof, when @samp{-femulate-complex} is in effect), -returning the result of the function in the same way as @code{gcc} would. +(or an emulation thereof, when @option{-femulate-complex} is in effect), +returning the result of the function in the same way as @command{gcc} would. -For @code{REAL(KIND=1)}, when @samp{-ff2c} is in force, @code{g77} implements +For @code{REAL(KIND=1)}, when @option{-ff2c} is in force, @command{g77} implements a function that actually returns @code{REAL(KIND=2)} (typically C's @code{double} type). -When @samp{-fno-f2c} is in force, @code{REAL(KIND=1)} +When @option{-fno-f2c} is in force, @code{REAL(KIND=1)} functions return @code{float}. @node Names @@ -6063,14 +6092,14 @@ as how casing is handled. External names---names of entities that are public, or ``accessible'', to all modules in a program---normally have an underscore (@samp{_}) -appended by @code{g77}, -to generate code that is compatible with @code{f2c}. +appended by @command{g77}, +to generate code that is compatible with @command{f2c}. External names include names of Fortran things like common blocks, external procedures (subroutines and functions, but not including statement functions, which are internal procedures), and entry point names. -However, use of the @samp{-fno-underscoring} option +However, use of the @option{-fno-underscoring} option disables this kind of transformation of external names (though inhibiting the transformation certainly improves the chances of colliding with incompatible externals written in other languages---but that @@ -6080,14 +6109,14 @@ might be intentional. @cindex options, -fno-underscoring @cindex -fno-second-underscore option @cindex options, -fno-underscoring -When @samp{-funderscoring} is in force, any name (external or local) +When @option{-funderscoring} is in force, any name (external or local) that already has at least one underscore in it is -implemented by @code{g77} by appending two underscores. +implemented by @command{g77} by appending two underscores. (This second underscore can be disabled via the -@samp{-fno-second-underscore} option.) -External names are changed this way for @code{f2c} compatibility. +@option{-fno-second-underscore} option.) +External names are changed this way for @command{f2c} compatibility. Local names are changed this way to avoid collisions with external names -that are different in the source code---@code{f2c} does the same thing, but +that are different in the source code---@command{f2c} does the same thing, but there's no compatibility issue there except for user expectations while debugging. @@ -6102,13 +6131,13 @@ Max_Cost = 0 Here, a user would, in the debugger, refer to this variable using the name @samp{max_cost__} (or @samp{MAX_COST__} or @samp{Max_Cost__}, as described below). -(We hope to improve @code{g77} in this regard in the future---don't +(We hope to improve @command{g77} in this regard in the future---don't write scripts depending on this behavior! -Also, consider experimenting with the @samp{-fno-underscoring} +Also, consider experimenting with the @option{-fno-underscoring} option to try out debugging without having to massage names by hand like this.) -@code{g77} provides a number of command-line options that allow the user +@command{g77} provides a number of command-line options that allow the user to control how case mapping is handled for source files. The default is the traditional UNIX model for Fortran compilers---names are mapped to lower case. @@ -6128,7 +6157,7 @@ This would be the name to enter when using a debugger to access the variable. However, depending on the command-line options specified, the -name implemented by @code{g77} might instead be @samp{FOO} or even +name implemented by @command{g77} might instead be @samp{FOO} or even @samp{Foo}, thus affecting how debugging is done. Also: @@ -6146,9 +6175,9 @@ void foo_() @end example @noindent -However, @code{g77} command-line options could be used to change the casing +However, @command{g77} command-line options could be used to change the casing of names, resulting in the name @samp{FOO_} or @samp{Foo_} being given to the -procedure instead of @samp{foo_}, and the @samp{-fno-underscoring} option +procedure instead of @samp{foo_}, and the @option{-fno-underscoring} option could be used to inhibit the appending of the underscore to the name. @node Common Blocks @@ -6157,9 +6186,9 @@ could be used to inhibit the appending of the underscore to the name. @cindex @code{COMMON} statement @cindex statements, @code{COMMON} -@code{g77} names and lays out @code{COMMON} areas -the same way @code{f2c} does, -for compatibility with @code{f2c}. +@command{g77} names and lays out @code{COMMON} areas +the same way @command{f2c} does, +for compatibility with @command{f2c}. @node Local Equivalence Areas @section Local Equivalence Areas (EQUIVALENCE) @@ -6168,19 +6197,19 @@ for compatibility with @code{f2c}. @cindex EQUIVALENCE statement @cindex statements, EQUIVALENCE -@code{g77} treats storage-associated areas involving a @code{COMMON} +@command{g77} treats storage-associated areas involving a @code{COMMON} block as explained in the section on common blocks. A local @code{EQUIVALENCE} area is a collection of variables and arrays connected to each other in any way via @code{EQUIVALENCE}, none of which are listed in a @code{COMMON} statement. -(@emph{Note:} @code{g77} version 0.5.18 and earlier chose the name +(@emph{Note:} @command{g77} version 0.5.18 and earlier chose the name for @var{x} using a different method when more than one name was in the list of names of entities placed at the beginning of the array. Though the documentation specified that the first name listed in -the @code{EQUIVALENCE} statements was chosen for @var{x}, @code{g77} +the @code{EQUIVALENCE} statements was chosen for @var{x}, @command{g77} in fact chose the name using a method that was so complicated, it seemed easier to change it to an alphabetical sort than to describe the previous method in the documentation.) @@ -6192,15 +6221,15 @@ previous method in the documentation.) @cindex COMPLEX statement @cindex statements, COMPLEX -As of 0.5.20, @code{g77} defaults to handling @code{COMPLEX} types +As of 0.5.20, @command{g77} defaults to handling @code{COMPLEX} types (and related intrinsics, constants, functions, and so on) in a manner that makes direct debugging involving these types in Fortran language mode difficult. -Essentially, @code{g77} implements these types using an +Essentially, @command{g77} implements these types using an internal construct similar to C's @code{struct}, at least -as seen by the @code{gcc} back end. +as seen by the @command{gcc} back end. Currently, the back end, when outputting debugging info with the compiled code for the assembler to digest, does not detect @@ -6271,7 +6300,7 @@ So the C equivalent in this case would be @samp{a[4293]}. When using a debugger directly on Fortran code, the C equivalent might not work, because some debuggers cannot understand the notion -of low bounds other than zero. However, unlike @code{f2c}, @code{g77} +of low bounds other than zero. However, unlike @command{f2c}, @command{g77} does inform the GBE that a multi-dimensional array (like @samp{A} in the above example) is really multi-dimensional, rather than a single-dimensional array, so at least the dimensionality of the array @@ -6312,7 +6341,7 @@ You know, maybe nobody really needs to use arrays. Adjustable and automatic arrays in Fortran require the implementation (in this -case, the @code{g77} compiler) to ``memorize'' the expressions that +case, the @command{g77} compiler) to ``memorize'' the expressions that dimension the arrays each time the procedure is invoked. This is so that subsequent changes to variables used in those expressions, made during execution of the procedure, do not @@ -6344,7 +6373,7 @@ like: Note that this shows that while the value of @samp{N} was successfully changed, the size of the @samp{A} array remained at 5 elements. -To support this, @code{g77} generates code that executes before any user +To support this, @command{g77} generates code that executes before any user code (and before the internally generated computed @code{GOTO} to handle alternate entry points, as described below) that evaluates each (nonconstant) expression in the list of subscripts for an @@ -6360,14 +6389,14 @@ Since the user program cannot (legitimately) change the value of the temporary during execution of the procedure, the size of the array remains constant during each invocation. -For alternate entry points, the code @code{g77} generates takes into +For alternate entry points, the code @command{g77} generates takes into account the possibility that a dummy adjustable array is not actually passed to the actual entry point being invoked at that time. In that case, the public procedure implementing the entry point passes to the master private procedure implementing all the code for the entry points a @code{NULL} pointer where a pointer to that adjustable array would be expected. -The @code{g77}-generated code +The @command{g77}-generated code doesn't attempt to evaluate any of the expressions in the subscripts for an array if the pointer to that array is @code{NULL} at run time in such cases. @@ -6377,7 +6406,7 @@ callee expects adjustable arrays, even if you know the callee won't reference the arrays---nor should you pass @code{NULL} pointers for any dummy arguments used in calculating the bounds of such arrays or leave undefined any values used for that purpose in -COMMON---because the way @code{g77} implements these things might +COMMON---because the way @command{g77} implements these things might change in the future!) @node Alternate Entry Points @@ -6389,20 +6418,20 @@ change in the future!) The GBE does not understand the general concept of alternate entry points as Fortran provides via the ENTRY statement. -@code{g77} gets around this by using an approach to compiling procedures +@command{g77} gets around this by using an approach to compiling procedures having at least one @code{ENTRY} statement that is almost identical to the -approach used by @code{f2c}. +approach used by @command{f2c}. (An alternate approach could be used that would probably generate faster, but larger, code that would also be a bit easier to debug.) -Information on how @code{g77} implements @code{ENTRY} is provided for those +Information on how @command{g77} implements @code{ENTRY} is provided for those trying to debug such code. The choice of implementation seems unlikely to affect code (compiled in other languages) that interfaces to such code. -@code{g77} compiles exactly one public procedure for the primary entry +@command{g77} compiles exactly one public procedure for the primary entry point of a procedure plus each @code{ENTRY} point it specifies, as usual. That is, in terms of the public interface, there is no difference between @@ -6428,7 +6457,7 @@ for the @samp{X} and @samp{Y} procedures themselves, plus the fact that, for the second case, an extra internal procedure is compiled. For every Fortran procedure with at least one @code{ENTRY} -statement, @code{g77} compiles an extra procedure +statement, @command{g77} compiles an extra procedure named @samp{__g77_masterfun_@var{x}}, where @var{x} is the name of the primary entry point (which, in the above case, using the standard compiler options, would be @samp{x_} in C). @@ -6441,7 +6470,7 @@ for the primary entry point plus for every entry point. The extra procedure has some other interesting characteristics. -The argument list for this procedure is invented by @code{g77}. +The argument list for this procedure is invented by @command{g77}. It contains a single integer argument named @samp{__g77_which_entrypoint}, passed by value (as in Fortran's @samp{%VAL()} intrinsic), specifying the @@ -6450,7 +6479,7 @@ first entry point (the first @code{ENTRY} statement encountered), 2 for the second entry point, and so on. It also contains, for functions returning @code{CHARACTER} and -(when @samp{-ff2c} is in effect) @code{COMPLEX} functions, +(when @option{-ff2c} is in effect) @code{COMPLEX} functions, and for functions returning different types among the @code{ENTRY} statements (e.g. @samp{REAL FUNCTION R()} containing @samp{ENTRY I()}), an argument named @samp{__g77_result} that @@ -6462,7 +6491,7 @@ for @code{COMPLEX} functions, it is the appropriate area for the return type; for multiple-return-type functions, it is a union of all the supported return types (which cannot include @code{CHARACTER}, since combining @code{CHARACTER} and non-@code{CHARACTER} return types via @code{ENTRY} in a single function -is not supported by @code{g77}). +is not supported by @command{g77}). For @code{CHARACTER} functions, the @samp{__g77_result} argument is followed by yet another argument named @samp{__g77_length} that, at run time, @@ -6494,7 +6523,7 @@ statement: @noindent (Note that invalid Fortran statement labels and variable names are used in the above example to highlight the fact that it -represents code generated by the @code{g77} internals, not code to be +represents code generated by the @command{g77} internals, not code to be written by the user.) It is this code that, when the procedure is called, picks which @@ -6550,7 +6579,7 @@ for an equivalent single-entry function. @cindex statements, RETURN Subroutines with alternate returns (e.g. @samp{SUBROUTINE X(*)} and -@samp{CALL X(*50)}) are implemented by @code{g77} as functions returning +@samp{CALL X(*50)}) are implemented by @command{g77} as functions returning the C @code{int} type. The actual alternate-return arguments are omitted from the calling sequence. Instead, the caller uses @@ -6573,14 +6602,14 @@ in C, and @samp{RETURN} by itself is @samp{X = 0} and @samp{RETURN}). @cindex statements, GOTO For portability to machines where a pointer (such as to a label, -which is how @code{g77} implements @code{ASSIGN} and its relatives, +which is how @command{g77} implements @code{ASSIGN} and its relatives, the assigned-@code{GOTO} and assigned-@code{FORMAT}-I/O statements) -is wider (bitwise) than an @code{INTEGER(KIND=1)}, @code{g77} +is wider (bitwise) than an @code{INTEGER(KIND=1)}, @command{g77} uses a different memory location to hold the @code{ASSIGN}ed value of a variable than it does the numerical value in that variable, unless the variable is wide enough (can hold enough bits). -In particular, while @code{g77} implements +In particular, while @command{g77} implements @example I = 10 @@ -6596,24 +6625,24 @@ ASSIGN 10 TO I @noindent as, in GNU's extended C notation (for the label syntax), @samp{__g77_ASSIGN_I = &&L10;} (where @samp{L10} is just a massaging -of the Fortran label @samp{10} to make the syntax C-like; @code{g77} doesn't +of the Fortran label @samp{10} to make the syntax C-like; @command{g77} doesn't actually generate the name @samp{L10} or any other name like that, since debuggers cannot access labels anyway). While this currently means that an @code{ASSIGN} statement does not overwrite the numeric contents of its target variable, @emph{do not} write any code depending on this feature. -@code{g77} has already changed this implementation across +@command{g77} has already changed this implementation across versions and might do so in the future. This information is provided only to make debugging Fortran programs -compiled with the current version of @code{g77} somewhat easier. +compiled with the current version of @command{g77} somewhat easier. If there's no debugger-visible variable named @samp{__g77_ASSIGN_I} in a program unit that does @samp{ASSIGN 10 TO I}, that probably -means @code{g77} has decided it can store the pointer to the label directly +means @command{g77} has decided it can store the pointer to the label directly into @samp{I} itself. @xref{Ugly Assigned Labels}, for information on a command-line option -to force @code{g77} to use the same storage for both normal and +to force @command{g77} to use the same storage for both normal and assigned-label uses of a variable. @node Run-time Library Errors @@ -6638,7 +6667,7 @@ so you can more easily change the actual numbers in the future. The information below is culled from the definition of @code{F_err} in @file{f/runtime/libI77/err.c} in the -@code{g77} source tree. +@command{g77} source tree. @smallexample 100: "error in format" @@ -6683,14 +6712,14 @@ of @code{F_err} in @file{f/runtime/libI77/err.c} in the @cindex writing code @cindex code, writing -Most users of @code{g77} can be divided into two camps: +Most users of @command{g77} can be divided into two camps: @itemize @bullet @item -Those writing new Fortran code to be compiled by @code{g77}. +Those writing new Fortran code to be compiled by @command{g77}. @item -Those using @code{g77} to compile existing, ``legacy'' code. +Those using @command{g77} to compile existing, ``legacy'' code. @end itemize Users writing new code generally understand most of the necessary @@ -6702,15 +6731,15 @@ Users dealing with ``legacy'' code sometimes don't have much experience with Fortran, but believe that the code they're compiling already works when compiled by other compilers (and might not understand why, as is sometimes the case, it doesn't work -when compiled by @code{g77}). +when compiled by @command{g77}). The following information is designed to help users do a better job coping with existing, ``legacy'' Fortran code, and with writing new code as well. @menu -* Advantages Over f2c:: If @code{f2c} is so great, why @code{g77}? -* Block Data and Libraries:: How @code{g77} solves a common problem. +* Advantages Over f2c:: If @command{f2c} is so great, why @command{g77}? +* Block Data and Libraries:: How @command{g77} solves a common problem. * Loops:: Fortran @code{DO} loops surprise many people. * Working Programs:: Getting programs to work should be done first. * Overly Convenient Options:: Temptations to avoid, habits to not form. @@ -6720,11 +6749,11 @@ new code as well. @node Advantages Over f2c @section Advantages Over f2c -Without @code{f2c}, @code{g77} would have taken much longer to +Without @command{f2c}, @command{g77} would have taken much longer to do and probably not been as good for quite a while. -Sometimes people who notice how much @code{g77} depends on, and -documents encouragement to use, @code{f2c} ask why @code{g77} -was created if @code{f2c} already existed. +Sometimes people who notice how much @command{g77} depends on, and +documents encouragement to use, @command{f2c} ask why @command{g77} +was created if @command{f2c} already existed. This section gives some basic answers to these questions, though it is not intended to be comprehensive. @@ -6742,7 +6771,7 @@ is not intended to be comprehensive. @node Language Extensions @subsection Language Extensions -@code{g77} offers several extensions to FORTRAN 77 language that @code{f2c} +@command{g77} offers several extensions to FORTRAN 77 language that @command{f2c} doesn't: @itemize @bullet @@ -6779,12 +6808,12 @@ with routines known to compiler as intrinsics to change the interfaces used by Fortran routines) @end itemize -@code{g77} also implements iterative @code{DO} loops +@command{g77} also implements iterative @code{DO} loops so that they work even in the presence of certain ``extreme'' inputs, -unlike @code{f2c}. +unlike @command{f2c}. @xref{Loops}. -However, @code{f2c} offers a few that @code{g77} doesn't, such as: +However, @command{f2c} offers a few that @command{g77} doesn't, such as: @itemize @bullet @item @@ -6797,14 +6826,14 @@ Array bounds expressions (such as @samp{REAL M(N(2))}) @code{AUTOMATIC} statement @end itemize -It is expected that @code{g77} will offer some or all of these missing +It is expected that @command{g77} will offer some or all of these missing features at some time in the future. @node Diagnostic Abilities @subsection Diagnostic Abilities -@code{g77} offers better diagnosis of problems in @code{FORMAT} statements. -@code{f2c} doesn't, for example, emit any diagnostic for +@command{g77} offers better diagnosis of problems in @code{FORMAT} statements. +@command{f2c} doesn't, for example, emit any diagnostic for @samp{FORMAT(XZFAJG10324)}, leaving that to be diagnosed, at run time, by the @code{libf2c} run-time library. @@ -6812,7 +6841,7 @@ the @code{libf2c} run-time library. @node Compiler Options @subsection Compiler Options -@code{g77} offers compiler options that @code{f2c} doesn't, +@command{g77} offers compiler options that @command{f2c} doesn't, most of which are designed to more easily accommodate legacy code: @@ -6845,9 +6874,9 @@ One to specify the the source code is written in Fortran-90-style free-form @end itemize -However, @code{f2c} offers a few that @code{g77} doesn't, +However, @command{f2c} offers a few that @command{g77} doesn't, like an option to have @code{REAL} default to @code{REAL*8}. -It is expected that @code{g77} will offer all of the +It is expected that @command{g77} will offer all of the missing options pertinent to being a Fortran compiler at some time in the future. @@ -6855,72 +6884,72 @@ at some time in the future. @subsection Compiler Speed Saving the steps of writing and then rereading C code is a big reason -why @code{g77} should be able to compile code much faster than using -@code{f2c} in conjunction with the equivalent invocation of @code{gcc}. +why @command{g77} should be able to compile code much faster than using +@command{f2c} in conjunction with the equivalent invocation of @command{gcc}. -However, due to @code{g77}'s youth, lots of self-checking is still being +However, due to @command{g77}'s youth, lots of self-checking is still being performed. As a result, this improvement is as yet unrealized (though the potential seems to be there for quite a big speedup in the future). -It is possible that, as of version 0.5.18, @code{g77} +It is possible that, as of version 0.5.18, @command{g77} is noticeably faster compiling many Fortran source files than using -@code{f2c} in conjunction with @code{gcc}. +@command{f2c} in conjunction with @command{gcc}. @node Program Speed @subsection Program Speed -@code{g77} has the potential to better optimize code than @code{f2c}, -even when @code{gcc} is used to compile the output of @code{f2c}, -because @code{f2c} must necessarily +@command{g77} has the potential to better optimize code than @command{f2c}, +even when @command{gcc} is used to compile the output of @command{f2c}, +because @command{f2c} must necessarily translate Fortran into a somewhat lower-level language (C) that cannot preserve all the information that is potentially useful for optimization, -while @code{g77} can gather, preserve, and transmit that information directly +while @command{g77} can gather, preserve, and transmit that information directly to the GBE. -For example, @code{g77} implements @code{ASSIGN} and assigned +For example, @command{g77} implements @code{ASSIGN} and assigned @code{GOTO} using direct assignment of pointers to labels and direct -jumps to labels, whereas @code{f2c} maps the assigned labels to +jumps to labels, whereas @command{f2c} maps the assigned labels to integer values and then uses a C @code{switch} statement to encode the assigned @code{GOTO} statements. However, as is typical, theory and reality don't quite match, at least -not in all cases, so it is still the case that @code{f2c} plus @code{gcc} -can generate code that is faster than @code{g77}. +not in all cases, so it is still the case that @command{f2c} plus @command{gcc} +can generate code that is faster than @command{g77}. -Version 0.5.18 of @code{g77} offered default -settings and options, via patches to the @code{gcc} +Version 0.5.18 of @command{g77} offered default +settings and options, via patches to the @command{gcc} back end, that allow for better program speed, though some of these improvements also affected the performance -of programs translated by @code{f2c} and then compiled -by @code{g77}'s version of @code{gcc}. +of programs translated by @command{f2c} and then compiled +by @command{g77}'s version of @command{gcc}. -Version 0.5.20 of @code{g77} offers further performance +Version 0.5.20 of @command{g77} offers further performance improvements, at least one of which (alias analysis) is -not generally applicable to @code{f2c} (though @code{f2c} +not generally applicable to @command{f2c} (though @command{f2c} could presumably be changed to also take advantage of -this new capability of the @code{gcc} back end, assuming -this is made available in an upcoming release of @code{gcc}). +this new capability of the @command{gcc} back end, assuming +this is made available in an upcoming release of @command{gcc}). @node Ease of Debugging @subsection Ease of Debugging -Because @code{g77} compiles directly to assembler code like @code{gcc}, -instead of translating to an intermediate language (C) as does @code{f2c}, -support for debugging can be better for @code{g77} than @code{f2c}. +Because @command{g77} compiles directly to assembler code like @command{gcc}, +instead of translating to an intermediate language (C) as does @command{f2c}, +support for debugging can be better for @command{g77} than @command{f2c}. -However, although @code{g77} might be somewhat more ``native'' in terms of -debugging support than @code{f2c} plus @code{gcc}, there still are a lot +However, although @command{g77} might be somewhat more ``native'' in terms of +debugging support than @command{f2c} plus @command{gcc}, there still are a lot of things ``not quite right''. Many of the important ones should be resolved in the near future. -For example, @code{g77} doesn't have to worry about reserved names -like @code{f2c} does. -Given @samp{FOR = WHILE}, @code{f2c} must necessarily +For example, @command{g77} doesn't have to worry about reserved names +like @command{f2c} does. +Given @samp{FOR = WHILE}, @command{f2c} must necessarily translate this to something @emph{other} than @samp{for = while;}, because C reserves those words. -However, @code{g77} does still uses things like an extra level of indirection +However, @command{g77} does still uses things like an extra level of indirection for @code{ENTRY}-laden procedures---in this case, because the back end doesn't yet support multiple entry points. @@ -6932,12 +6961,12 @@ EQUIVALENCE (B, C) @end smallexample @noindent -the @code{g77} user should be able to access the variables directly, by name, -without having to traverse C-like structures and unions, while @code{f2c} +the @command{g77} user should be able to access the variables directly, by name, +without having to traverse C-like structures and unions, while @command{f2c} is unlikely to ever offer this ability (due to limitations in the C language). -However, due to apparent bugs in the back end, @code{g77} currently doesn't +However, due to apparent bugs in the back end, @command{g77} currently doesn't take advantage of this facility at all---it doesn't emit any debugging information for @code{COMMON} and @code{EQUIVALENCE} areas, other than information @@ -6945,22 +6974,22 @@ on the array of @code{char} it creates (and, in the case of local @code{EQUIVALENCE}, names) for each such area. Yet another example is arrays. -@code{g77} represents them to the debugger -using the same ``dimensionality'' as in the source code, while @code{f2c} +@command{g77} represents them to the debugger +using the same ``dimensionality'' as in the source code, while @command{f2c} must necessarily convert them all to one-dimensional arrays to fit into the confines of the C language. However, the level of support offered by debuggers for interactive Fortran-style access to arrays -as compiled by @code{g77} can vary widely. +as compiled by @command{g77} can vary widely. In some cases, it can actually -be an advantage that @code{f2c} converts everything to widely supported +be an advantage that @command{f2c} converts everything to widely supported C semantics. -In fairness, @code{g77} could do many of the things @code{f2c} does -to get things working at least as well as @code{f2c}---for now, -the developers prefer making @code{g77} work the +In fairness, @command{g77} could do many of the things @command{f2c} does +to get things working at least as well as @command{f2c}---for now, +the developers prefer making @command{g77} work the way they think it is supposed to, and finding help improving the -other products (the back end of @code{gcc}; @code{gdb}; and so on) +other products (the back end of @command{gcc}; @code{gdb}; and so on) to get things working properly. @node Character and Hollerith Constants @@ -6974,19 +7003,19 @@ to get things working properly. @cindex zero byte, trailing To avoid the extensive hassle that would be needed to avoid this, -@code{f2c} uses C character constants to encode character and Hollerith +@command{f2c} uses C character constants to encode character and Hollerith constants. That means a constant like @samp{'HELLO'} is translated to @samp{"hello"} in C, which further means that an extra null byte is present at the end of the constant. This null byte is superfluous. -@code{g77} does not generate such null bytes. +@command{g77} does not generate such null bytes. This represents significant savings of resources, such as on systems where @file{/dev/null} or @file{/dev/zero} represent bottlenecks in the systems' performance, -because @code{g77} simply asks for fewer zeros from the operating -system than @code{f2c}. +because @command{g77} simply asks for fewer zeros from the operating +system than @command{f2c}. (Avoiding spurious use of zero bytes, each byte typically have eight zero bits, also reduces the liabilities in case Microsoft's rumored patent on the digits 0 and 1 is upheld.) @@ -7005,29 +7034,29 @@ when they are put into libraries, give each one a name (as in @samp{BLOCK DATA FOO}) and make sure there is an @samp{EXTERNAL FOO} statement in every program unit that uses any common block initialized by the corresponding @code{BLOCK DATA}. -@code{g77} currently compiles a @code{BLOCK DATA} as if it were a +@command{g77} currently compiles a @code{BLOCK DATA} as if it were a @code{SUBROUTINE}, that is, it generates an actual procedure having the appropriate name. The procedure does nothing but return immediately if it happens to be called. For @samp{EXTERNAL FOO}, where @samp{FOO} is not otherwise referenced in the -same program unit, @code{g77} assumes there exists a @samp{BLOCK DATA FOO} +same program unit, @command{g77} assumes there exists a @samp{BLOCK DATA FOO} in the program and ensures that by generating a reference to it so the linker will make sure it is present. -(Specifically, @code{g77} outputs in the data section a static pointer to the +(Specifically, @command{g77} outputs in the data section a static pointer to the external name @samp{FOO}.) -The implementation @code{g77} currently uses to make this work is -one of the few things not compatible with @code{f2c} as currently +The implementation @command{g77} currently uses to make this work is +one of the few things not compatible with @command{f2c} as currently shipped. -@code{f2c} currently does nothing with @samp{EXTERNAL FOO} except +@command{f2c} currently does nothing with @samp{EXTERNAL FOO} except issue a warning that @samp{FOO} is not otherwise referenced, and, for @samp{BLOCK DATA FOO}, -@code{f2c} doesn't generate a dummy procedure with the name @samp{FOO}. -The upshot is that you shouldn't mix @code{f2c} and @code{g77} in +@command{f2c} doesn't generate a dummy procedure with the name @samp{FOO}. +The upshot is that you shouldn't mix @command{f2c} and @command{g77} in this particular case. -If you use @code{f2c} to compile @samp{BLOCK DATA FOO}, -then any @code{g77}-compiled program unit that says @samp{EXTERNAL FOO} +If you use @command{f2c} to compile @samp{BLOCK DATA FOO}, +then any @command{g77}-compiled program unit that says @samp{EXTERNAL FOO} will result in an unresolved reference when linked. If you do the opposite, then @samp{FOO} might not be linked in under various @@ -7036,7 +7065,7 @@ using a ``clever'' linker---so clever, it produces a broken program with little or no warning by omitting initializations of global data because they are contained in unreferenced procedures). -The changes you make to your code to make @code{g77} handle this situation, +The changes you make to your code to make @command{g77} handle this situation, however, appear to be a widely portable way to handle it. That is, many systems permit it (as they should, since the FORTRAN 77 standard permits @samp{EXTERNAL FOO} when @samp{FOO} @@ -7082,7 +7111,7 @@ END @end smallexample @noindent -That way, @samp{CURX} is compiled by @code{g77} (and many other +That way, @samp{CURX} is compiled by @command{g77} (and many other compilers) so that the linker knows it must include @samp{FOO}, the @code{BLOCK DATA} program unit that sets the initial values for the variables in @samp{VAR}, in the executable program. @@ -7165,7 +7194,7 @@ END DO @noindent The simple @code{DO} construct and the @code{EXIT} statement (used to leave the innermost loop) -are F90 features that @code{g77} supports. +are F90 features that @command{g77} supports. Some Fortran compilers have buggy implementations of @code{DO}, in that they don't follow the standard. @@ -7187,7 +7216,7 @@ DO I = 2147483600, 2147483647 @noindent A loop started by the above statement will work as implemented -by @code{g77}, but the use, by some compilers, of a +by @command{g77}, but the use, by some compilers, of a more C-like implementation akin to @smallexample @@ -7220,7 +7249,7 @@ Consider the following program: A C-like view of @code{DO} would hold that the two ``exclamatory'' @code{PRINT} statements are never executed. However, this is the output of running the above program -as compiled by @code{g77} on a GNU/Linux ix86 system: +as compiled by @command{g77} on a GNU/Linux ix86 system: @smallexample .100000001 @@ -7237,14 +7266,14 @@ LAST = .310000002 Note that one of the two checks in the program turned up an apparent violation of the programmer's expectation---yet, -the loop is correctly implemented by @code{g77}, in that +the loop is correctly implemented by @command{g77}, in that it has 30 iterations. This trip count of 30 is correct when evaluated using the floating-point representations for the @var{begin}, @var{end}, and @var{incr} values (.1, .31, .007) on GNU/Linux ix86 are used. On other systems, an apparently more accurate trip count -of 31 might result, but, nevertheless, @code{g77} is +of 31 might result, but, nevertheless, @command{g77} is faithfully following the Fortran standard, and the result is not what the author of the sample program above apparently expected. @@ -7255,10 +7284,10 @@ for example.) Due to this combination of imprecise representation of floating-point values and the often-misunderstood interpretation of @code{DO} by standard-conforming -compilers such as @code{g77}, use of @code{DO} loops +compilers such as @command{g77}, use of @code{DO} loops with @code{REAL} iteration variables is not recommended. -Such use can be caught by specifying @samp{-Wsurprising}. +Such use can be caught by specifying @option{-Wsurprising}. @xref{Warning Options}, for more information on this option. @@ -7269,7 +7298,7 @@ Getting Fortran programs to work in the first place can be quite a challenge---even when the programs already work on other systems, or when using other compilers. -@code{g77} offers some facilities that might be useful for +@command{g77} offers some facilities that might be useful for tracking down bugs in such programs. @menu @@ -7313,7 +7342,7 @@ is likely to assume it returns @code{INTEGER}, or some other type, leading to invalid results or even program crashes. -The @samp{-Wimplicit} option might catch failures to +The @option{-Wimplicit} option might catch failures to properly specify the types of variables, arrays, and functions in the code. @@ -7325,10 +7354,10 @@ This is why so many experienced Fortran programmers strongly recommend widespread use of the @code{IMPLICIT NONE} statement, despite it not being standard FORTRAN 77, to completely turn off implicit typing. -(@code{g77} supports @code{IMPLICIT NONE}, as do almost all +(@command{g77} supports @code{IMPLICIT NONE}, as do almost all FORTRAN 77 compilers.) -Note that @samp{-Wimplicit} catches only implicit typing of +Note that @option{-Wimplicit} catches only implicit typing of @emph{names}. It does not catch implicit typing of expressions such as @samp{X**(2/3)}. @@ -7351,18 +7380,18 @@ As a result, many of these programs depend, sometimes inadvertently, on this behavior, though to do so violates the Fortran standards. -You can ask @code{g77} for this behavior by specifying the -@samp{-finit-local-zero} option when compiling Fortran code. -(You might want to specify @samp{-fno-automatic} as well, +You can ask @command{g77} for this behavior by specifying the +@option{-finit-local-zero} option when compiling Fortran code. +(You might want to specify @option{-fno-automatic} as well, to avoid code-size inflation for non-optimized compilations.) Note that a program that works better when compiled with the -@samp{-finit-local-zero} option +@option{-finit-local-zero} option is almost certainly depending on a particular system's, or compiler's, tendency to initialize some variables to zero. It might be worthwhile finding such cases and fixing them, -using techniques such as compiling with the @samp{-O -Wuninitialized} -options using @code{g77}. +using techniques such as compiling with the @option{-O -Wuninitialized} +options using @command{g77}. @node Variables Assumed To Be Saved @subsection Variables Assumed To Be Saved @@ -7386,24 +7415,24 @@ Depending on variables and arrays to retain values across procedure calls without using @code{SAVE} to require it violates the Fortran standards. -You can ask @code{g77} to assume @code{SAVE} is specified for all +You can ask @command{g77} to assume @code{SAVE} is specified for all relevant (local) variables and arrays by using the -@samp{-fno-automatic} option. +@option{-fno-automatic} option. Note that a program that works better when compiled with the -@samp{-fno-automatic} option +@option{-fno-automatic} option is almost certainly depending on not having to use the @code{SAVE} statement as required by the Fortran standard. It might be worthwhile finding such cases and fixing them, using techniques such as compiling with the @samp{-O -Wuninitialized} -options using @code{g77}. +options using @command{g77}. @node Unwanted Variables @subsection Unwanted Variables -The @samp{-Wunused} option can find bugs involving +The @option{-Wunused} option can find bugs involving implicit typing, sometimes -more easily than using @samp{-Wimplicit} in code that makes +more easily than using @option{-Wimplicit} in code that makes heavy use of implicit typing. An unused variable or array might indicate that the spelling for its declaration is different from that of @@ -7428,23 +7457,23 @@ to a procedure might indicate a bug. Compile with @samp{-W -Wunused} option to catch cases of unused arguments. -Note that @samp{-W} also enables warnings regarding overflow +Note that @option{-W} also enables warnings regarding overflow of floating-point constants under certain circumstances. @node Surprising Interpretations of Code @subsection Surprising Interpretations of Code -The @samp{-Wsurprising} option can help find bugs involving +The @option{-Wsurprising} option can help find bugs involving expression evaluation or in the way @code{DO} loops with non-integral iteration variables are handled. Cases found by this option might indicate a difference of interpretation between the author of the code involved, and -a standard-conforming compiler such as @code{g77}. +a standard-conforming compiler such as @command{g77}. Such a difference might produce actual bugs. In any case, changing the code to explicitly do what the -programmer might have expected it to do, so @code{g77} and +programmer might have expected it to do, so @command{g77} and other compilers are more likely to follow the programmer's expectations, might be worthwhile, especially if such changes make the program work better. @@ -7468,33 +7497,33 @@ make the program work better. @cindex scheduling of reads and writes @cindex reads and writes, scheduling -The @samp{-falias-check}, @samp{-fargument-alias}, -@samp{-fargument-noalias}, -and @samp{-fno-argument-noalias-global} options, +The @option{-falias-check}, @option{-fargument-alias}, +@option{-fargument-noalias}, +and @option{-fno-argument-noalias-global} options, introduced in version 0.5.20 and -@code{g77}'s version 2.7.2.2.f.2 of @code{gcc}, -were withdrawn as of @code{g77} version 0.5.23 -due to their not being supported by @code{gcc} version 2.8. +@command{g77}'s version 2.7.2.2.f.2 of @command{gcc}, +were withdrawn as of @command{g77} version 0.5.23 +due to their not being supported by @command{gcc} version 2.8. These options control the assumptions regarding aliasing (overlapping) of writes and reads to main memory (core) made -by the @code{gcc} back end. +by the @command{gcc} back end. The information below still is useful, but applies to -only those versions of @code{g77} that support the +only those versions of @command{g77} that support the alias analysis implied by support for these options. -These options are effective only when compiling with @samp{-O} -(specifying any level other than @samp{-O0}) -or with @samp{-falias-check}. +These options are effective only when compiling with @option{-O} +(specifying any level other than @option{-O0}) +or with @option{-falias-check}. -The default for Fortran code is @samp{-fargument-noalias-global}. +The default for Fortran code is @option{-fargument-noalias-global}. (The default for C code and code written in other C-based languages -is @samp{-fargument-alias}. -These defaults apply regardless of whether you use @code{g77} or -@code{gcc} to compile your code.) +is @option{-fargument-alias}. +These defaults apply regardless of whether you use @command{g77} or +@command{gcc} to compile your code.) -Note that, on some systems, compiling with @samp{-fforce-addr} in +Note that, on some systems, compiling with @option{-fforce-addr} in effect can produce more optimal code when the default aliasing options are in effect (and when optimization is enabled). @@ -7508,7 +7537,7 @@ set up this kind of aliasing. (The FORTRAN 77 standard's prohibition of this sort of overlap, generally referred to therein as ``storage assocation'', appears in Sections 15.9.3.6. -This prohibition allows implementations, such as @code{g77}, +This prohibition allows implementations, such as @command{g77}, to, for example, implement the passing of procedures and even values in @code{COMMON} via copy operations into local, perhaps more efficiently accessed temporaries at entry to a @@ -7519,17 +7548,17 @@ order in which the local copies are updated by the code, among other things.) To test this hypothesis, try compiling your program with -the @samp{-fargument-alias} option, which causes the +the @option{-fargument-alias} option, which causes the compiler to revert to assumptions essentially the same as -made by versions of @code{g77} prior to 0.5.20. +made by versions of @command{g77} prior to 0.5.20. If the program works using this option, that strongly suggests that the bug is in your program. Finding and fixing the bug(s) should result in a program that -is more standard-conforming and that can be compiled by @code{g77} +is more standard-conforming and that can be compiled by @command{g77} in a way that results in a faster executable. -(You might want to try compiling with @samp{-fargument-noalias}, +(You might want to try compiling with @option{-fargument-noalias}, a kind of half-way point, to see if the problem is limited to aliasing between dummy arguments and @code{COMMON} variables---this option assumes that such aliasing is not done, while still allowing @@ -7614,10 +7643,10 @@ only those violations that actually happen during a particular run. Neither approach can cope with programs mixing Fortran code with routines written in other languages, however.) -Currently, @code{g77} provides neither static nor run-time facilities +Currently, @command{g77} provides neither static nor run-time facilities to detect any cases of this problem, although other products might. Run-time facilities are more likely to be offered by future -versions of @code{g77}, though patches improving @code{g77} so that +versions of @command{g77}, though patches improving @command{g77} so that it provides either form of detection are welcome. @node Output Assumed To Flush @@ -7633,7 +7662,7 @@ it provides either form of detection are welcome. @cindex NFS @cindex network file system -For several versions prior to 0.5.20, @code{g77} configured its +For several versions prior to 0.5.20, @command{g77} configured its version of the @code{libf2c} run-time library so that one of its configuration macros, @code{ALWAYS_FLUSH}, was defined. @@ -7644,17 +7673,17 @@ such as disk full, would be immediately flagged via the relevant @code{ERR=} and @code{IOSTAT=} mechanism. Because of the adverse effects this approach had on the performance -of many programs, @code{g77} no longer configures @code{libf2c} -(now named @code{libg2c} in its @code{g77} incarnation) +of many programs, @command{g77} no longer configures @code{libf2c} +(now named @code{libg2c} in its @command{g77} incarnation) to always flush output. If your program depends on this behavior, either insert the appropriate @samp{CALL FLUSH} statements, or modify the sources -to the @code{libg2c}, rebuild and reinstall @code{g77}, and +to the @code{libg2c}, rebuild and reinstall @command{g77}, and relink your programs with the modified library. (Ideally, @code{libg2c} would offer the choice at run-time, so -that a compile-time option to @code{g77} or @code{f2c} could +that a compile-time option to @command{g77} or @command{f2c} could result in generating the appropriate calls to flushing or non-flushing library routines.) @@ -7681,13 +7710,13 @@ effect can be more reliable, robust file I/O. If you know that Fortran programs requiring this level of precision of error reporting are to be compiled using the -version of @code{g77} you are building, you might wish to -modify the @code{g77} source tree so that the version of +version of @command{g77} you are building, you might wish to +modify the @command{g77} source tree so that the version of @code{libg2c} is built with the @code{ALWAYS_FLUSH} macro defined, enabling this behavior. To do this, find this line in @file{@value{path-libf2c}/f2c.h} in -your @code{g77} source tree: +your @command{g77} source tree: @example /* #define ALWAYS_FLUSH */ @@ -7697,7 +7726,7 @@ Remove the leading @samp{/*@w{ }}, so the line begins with @samp{#define}, and the trailing @samp{@w{ }*/}. -Then build or rebuild @code{g77} as appropriate. +Then build or rebuild @command{g77} as appropriate. @node Large File Unit Numbers @subsection Large File Unit Numbers @@ -7721,7 +7750,7 @@ macro named @code{MXUNIT}. If you can easily change your program to use unit numbers in the range 0 through 99, you should do so. -As distributed, whether as part of @code{f2c} or @code{g77}, +As distributed, whether as part of @command{f2c} or @command{g77}, @code{libf2c} accepts file unit numbers only in the range 0 through 99. For example, a statement such as @samp{WRITE (UNIT=100)} causes @@ -7734,7 +7763,7 @@ value of the @code{MXUNIT} macro, which represents the maximum unit number, to an appropriately higher value. To do this, edit the file @file{@value{path-libf2c}/libI77/fio.h} in your -@code{g77} source tree, changing the following line: +@command{g77} source tree, changing the following line: @example #define MXUNIT 100 @@ -7747,7 +7776,7 @@ the Fortran programs on your system. (For example, a program that does @samp{WRITE (UNIT=255)} would require @code{MXUNIT} set to at least 256 to avoid crashing.) -Then build or rebuild @code{g77} as appropriate. +Then build or rebuild @command{g77} as appropriate. @emph{Note:} Changing this macro has @emph{no} effect on other limits your system might place on the number of files open at the same time. @@ -7768,12 +7797,12 @@ in your system's documentation. @cindex x86 floating-point If your program depends on exact IEEE 754 floating-point handling it may help on some systems---specifically x86 or m68k hardware---to use -the @samp{-ffloat-store} option or to reset the precision flag on the +the @option{-ffloat-store} option or to reset the precision flag on the floating-point unit. @xref{Optimize Options}. However, it might be better simply to put the FPU into double precision -mode and not take the performance hit of @samp{-ffloat-store}. On x86 +mode and not take the performance hit of @option{-ffloat-store}. On x86 and m68k GNU systems you can do this with a technique similar to that for turning on floating-point exceptions (@pxref{Floating-point Exception Handling}). @@ -7805,7 +7834,7 @@ normally rejected---see @ref{GLOBALS}. (Use, say, @code{ftnchek} to ensure consistency across source files. @xref{f2c Skeletons and Prototypes,, -Generating Skeletons and Prototypes with @code{f2c}}.) +Generating Skeletons and Prototypes with @command{f2c}}.) Mysterious errors, which may appear to be code generation problems, can appear specifically on the x86 architecture with some such @@ -7846,11 +7875,11 @@ Fortran code developed with those compilers depends on it. It is safer (and probably would produce a faster program) to find the variables and arrays that need such initialization and provide it explicitly via @code{DATA}, so that -@samp{-finit-local-zero} is not needed. +@option{-finit-local-zero} is not needed. -Consider using @samp{-Wuninitialized} (which requires @samp{-O}) to +Consider using @option{-Wuninitialized} (which requires @option{-O}) to find likely candidates, but -do not specify @samp{-finit-local-zero} or @samp{-fno-automatic}, +do not specify @option{-finit-local-zero} or @option{-fno-automatic}, or this technique won't work. @cindex -fno-automatic option @@ -7868,12 +7897,12 @@ This might cause a buggy program to appear to work better. If so, rather than relying on this command-line option (and hoping all compilers provide the equivalent one), add @code{SAVE} statements to some or all program unit sources, as appropriate. -Consider using @samp{-Wuninitialized} (which requires @samp{-O}) +Consider using @option{-Wuninitialized} (which requires @option{-O}) to find likely candidates, but -do not specify @samp{-finit-local-zero} or @samp{-fno-automatic}, +do not specify @option{-finit-local-zero} or @option{-fno-automatic}, or this technique won't work. -The default is @samp{-fautomatic}, which tells @code{g77} to try +The default is @option{-fautomatic}, which tells @command{g77} to try and put variables and arrays on the stack (or in fast registers) where possible and reasonable. This tends to make programs faster. @@ -7889,7 +7918,7 @@ Examples include local variables and arrays not given the @code{SAVE} attribute in procedures declared @code{RECURSIVE}, and local arrays declared with non-constant bounds (automatic arrays). -Currently, @code{g77} supports only automatic arrays, not +Currently, @command{g77} supports only automatic arrays, not @code{RECURSIVE} procedures or other means of explicitly specifying that variables or arrays are automatic. @@ -7898,7 +7927,7 @@ specifying that variables or arrays are automatic. @item -f@var{group}-intrinsics-hide Change the source code to use @code{EXTERNAL} for any external procedure that might be the name of an intrinsic. -It is easy to find these using @samp{-f@var{group}-intrinsics-disable}. +It is easy to find these using @option{-f@var{group}-intrinsics-disable}. @end table @node Faster Programs @@ -7906,8 +7935,8 @@ It is easy to find these using @samp{-f@var{group}-intrinsics-disable}. @cindex speed, of programs @cindex programs, speeding up -Aside from the usual @code{gcc} options, such as @samp{-O}, -@samp{-ffast-math}, and so on, consider trying some of the +Aside from the usual @command{gcc} options, such as @option{-O}, +@option{-ffast-math}, and so on, consider trying some of the following approaches to speed up your program (once you get it working). @@ -7994,25 +8023,25 @@ possible requirement, which is compiler-independent on a given platform.) @item @cindex -malign-double option @cindex options, -malign-double -Use the (x86-specific) @samp{-malign-double} option when compiling +Use the (x86-specific) @option{-malign-double} option when compiling programs for the Pentium and Pentium Pro architectures (called 586 -and 686 in the @code{gcc} configuration subsystem). -The warning about this in the @code{gcc} manual isn't +and 686 in the @command{gcc} configuration subsystem). +The warning about this in the @command{gcc} manual isn't generally relevant to Fortran, but using it will force @code{COMMON} to be padded if necessary to align @code{DOUBLE PRECISION} data. When @code{DOUBLE PRECISION} data is forcibly aligned -in @code{COMMON} by @code{g77} due to specifying @samp{-malign-double}, -@code{g77} issues a warning about the need to +in @code{COMMON} by @command{g77} due to specifying @option{-malign-double}, +@command{g77} issues a warning about the need to insert padding. In this case, each and every program unit that uses the same @code{COMMON} area must specify the same layout of variables and their types for that area -and be compiled with @samp{-malign-double} as well. -@code{g77} will issue warnings in each case, +and be compiled with @option{-malign-double} as well. +@command{g77} will issue warnings in each case, but as long as every program unit using that area is compiled with the same warnings, the resulting object files should work when linked together @@ -8034,65 +8063,65 @@ to obtain the optimal alignment. @end itemize Progress is being made on making this work -``out of the box'' on future versions of @code{g77}, -@code{gcc}, and some of the relevant operating systems +``out of the box'' on future versions of @command{g77}, +@command{gcc}, and some of the relevant operating systems (such as GNU/Linux). @cindex alignment testing @cindex testing alignment A package that tests the degree to which a Fortran compiler -(such as @code{g77}) +(such as @command{g77}) aligns 64-bit floating-point variables and arrays is available at @uref{ftp://alpha.gnu.org/gnu/g77/align/}. @node Prefer Automatic Uninitialized Variables @subsection Prefer Automatic Uninitialized Variables -If you're using @samp{-fno-automatic} already, you probably -should change your code to allow compilation with @samp{-fautomatic} +If you're using @option{-fno-automatic} already, you probably +should change your code to allow compilation with @option{-fautomatic} (the default), to allow the program to run faster. -Similarly, you should be able to use @samp{-fno-init-local-zero} -(the default) instead of @samp{-finit-local-zero}. +Similarly, you should be able to use @option{-fno-init-local-zero} +(the default) instead of @option{-finit-local-zero}. This is because it is rare that every variable affected by these options in a given program actually needs to be so affected. -For example, @samp{-fno-automatic}, which effectively @code{SAVE}s +For example, @option{-fno-automatic}, which effectively @code{SAVE}s every local non-automatic variable and array, affects even things like @code{DO} iteration variables, which rarely need to be @code{SAVE}d, and this often reduces run-time performances. -Similarly, @samp{-fno-init-local-zero} forces such +Similarly, @option{-fno-init-local-zero} forces such variables to be initialized to zero---when @code{SAVE}d (such as when -@samp{-fno-automatic}), this by itself generally affects only +@option{-fno-automatic}), this by itself generally affects only startup time for a program, but when not @code{SAVE}d, it can slow down the procedure every time it is called. @xref{Overly Convenient Options,,Overly Convenient Command-Line Options}, -for information on the @samp{-fno-automatic} and -@samp{-finit-local-zero} options and how to convert +for information on the @option{-fno-automatic} and +@option{-finit-local-zero} options and how to convert their use into selective changes in your own code. @node Avoid f2c Compatibility @subsection Avoid f2c Compatibility @cindex -fno-f2c option @cindex options, -fno-f2c -@cindex @code{f2c} compatibility -@cindex compatibility, @code{f2c} +@cindex @command{f2c} compatibility +@cindex compatibility, @command{f2c} If you aren't linking with any code compiled using -@code{f2c}, try using the @samp{-fno-f2c} option when +@command{f2c}, try using the @option{-fno-f2c} option when compiling @emph{all} the code in your program. (Note that @code{libf2c} is @emph{not} an example of code -that is compiled using @code{f2c}---it is compiled by a C -compiler, typically @code{gcc}.) +that is compiled using @command{f2c}---it is compiled by a C +compiler, typically @command{gcc}.) @node Use Submodel Options @subsection Use Submodel Options @cindex submodels -Using an appropriate @samp{-m} option to generate specific code for your +Using an appropriate @option{-m} option to generate specific code for your CPU may be worthwhile, though it may mean the executable won't run on other versions of the CPU that don't support the same instruction set. @xref{Submodel Options,,Hardware Models and Configurations,gcc,Using and @@ -8100,15 +8129,15 @@ Porting GNU CC}. For instance on an x86 system the compiler might have been built---as shown by @samp{g77 -v}---for the target @samp{i386-pc-linux-gnu}, i.e.@: an @samp{i386} CPU@. In that case to generate code best optimized for a Pentium you could use the option -@samp{-march=pentium}. +@option{-march=pentium}. For recent CPUs that don't have explicit support in the released version -of @code{gcc}, it @emph{might} still be possible to get improvements -with certain @samp{-m} options. +of @command{gcc}, it @emph{might} still be possible to get improvements +with certain @option{-m} options. -@samp{-fomit-frame-pointer} can help performance on x86 systems and +@option{-fomit-frame-pointer} can help performance on x86 systems and others. It will, however, inhibit debugging on the systems on which it -is not turned on anyway by @samp{-O}. +is not turned on anyway by @option{-O}. @node Trouble @chapter Known Causes of Trouble with GNU Fortran @@ -8130,16 +8159,16 @@ possible workarounds for them, see @uref{ftp://alpha.gnu.org/g77.plan}. (Note that some of this portion of the manual is lifted -directly from the @code{gcc} manual, with minor modifications -to tailor it to users of @code{g77}. -Anytime a bug seems to have more to do with the @code{gcc} -portion of @code{g77}, see +directly from the @command{gcc} manual, with minor modifications +to tailor it to users of @command{g77}. +Anytime a bug seems to have more to do with the @command{gcc} +portion of @command{g77}, see @ref{Trouble,,Known Causes of Trouble with GNU CC, gcc,Using and Porting GNU CC}.) @menu * But-bugs:: Bugs really in other programs or elsewhere. -* Known Bugs:: Bugs known to be in this version of @code{g77}. +* Known Bugs:: Bugs known to be in this version of @command{g77}. * Missing Features:: Features we already know we want to add later. * Disappointments:: Regrettable things we can't change. * Non-bugs:: Things we think are right, but some others disagree. @@ -8152,23 +8181,23 @@ gcc,Using and Porting GNU CC}.) @cindex but-bugs These are bugs to which the maintainers often have to reply, -``but that isn't a bug in @code{g77}@dots{}''. +``but that isn't a bug in @command{g77}@dots{}''. Some of these already are fixed in new versions of other software; some still need to be fixed; some are problems -with how @code{g77} is installed or is being used; +with how @command{g77} is installed or is being used; some are the result of bad hardware that causes software to misbehave in sometimes bizarre ways; some just cannot be addressed at this time until more is known about the problem. -Please don't re-report these bugs to the @code{g77} maintainers---if +Please don't re-report these bugs to the @command{g77} maintainers---if you must remind someone how important it is to you that the problem be fixed, talk to the people responsible for the other products identified below, but preferably only after you've tried the latest versions of those products. -The @code{g77} maintainers have their hands full working on -just fixing and improving @code{g77}, without serving as a -clearinghouse for all bugs that happen to affect @code{g77} +The @command{g77} maintainers have their hands full working on +just fixing and improving @command{g77}, without serving as a +clearinghouse for all bugs that happen to affect @command{g77} users. @xref{Collected Fortran Wisdom}, for information on behavior @@ -8224,7 +8253,7 @@ problem. In particular, on systems other than those running the Linux kernel, the message might appear somewhat or very different, as it will if the error manifests itself while running a -program other than the @code{g77} compiler. +program other than the @command{g77} compiler. For example, it will appear somewhat different when running your program, when running Emacs, and so on. @@ -8251,18 +8280,18 @@ a reference to it in future versions of this manual. @cindex @code{ld}, error linking user code @cindex @code{ld}, can't find strange names On some systems, perhaps just those with out-of-date (shared?) -libraries, unresolved-reference errors happen when linking @code{g77}-compiled -programs (which should be done using @code{g77}). +libraries, unresolved-reference errors happen when linking @command{g77}-compiled +programs (which should be done using @command{g77}). -If this happens to you, try appending @samp{-lc} to the command you +If this happens to you, try appending @option{-lc} to the command you use to link the program, e.g. @samp{g77 foo.f -lc}. -@code{g77} already specifies @samp{-lg2c -lm} when it calls the linker, -but it cannot also specify @samp{-lc} because not all systems have a +@command{g77} already specifies @samp{-lg2c -lm} when it calls the linker, +but it cannot also specify @option{-lc} because not all systems have a file named @file{libc.a}. It is unclear at this point whether there are legitimately installed systems where @samp{-lg2c -lm} is insufficient to resolve code produced -by @code{g77}. +by @command{g77}. @cindex undefined reference (_main) @cindex linking error, user code @@ -8270,15 +8299,15 @@ by @code{g77}. @cindex code, user @cindex @code{ld}, can't find @samp{_main} If your program doesn't link due to unresolved references to names -like @samp{_main}, make sure you're using the @code{g77} command to do the +like @samp{_main}, make sure you're using the @command{g77} command to do the link, since this command ensures that the necessary libraries are -loaded by specifying @samp{-lg2c -lm} when it invokes the @code{gcc} +loaded by specifying @samp{-lg2c -lm} when it invokes the @command{gcc} command to do the actual link. -(Use the @samp{-v} option to discover -more about what actually happens when you use the @code{g77} and @code{gcc} +(Use the @option{-v} option to discover +more about what actually happens when you use the @command{g77} and @command{gcc} commands.) -Also, try specifying @samp{-lc} as the last item on the @code{g77} +Also, try specifying @option{-lc} as the last item on the @command{g77} command line, in case that helps. @node Large Common Blocks @@ -8300,7 +8329,7 @@ more recent versions of @code{binutils}, such as version 2.6. @cindex @code{gdb}, support @cindex support, @code{gdb} There are some known problems when using @code{gdb} on code -compiled by @code{g77}. +compiled by @command{g77}. Inadequate investigation as of the release of 0.5.16 results in not knowing which products are the culprit, but @file{gdb-4.14} definitely crashes when, for example, an attempt is made to print the contents @@ -8309,7 +8338,7 @@ machines, plus some others. Attempts to access assumed-size arrays are also known to crash recent versions of @code{gdb}. (@code{gdb}'s Fortran support was done for a different compiler -and isn't properly compatible with @code{g77}.) +and isn't properly compatible with @command{g77}.) @node NeXTStep Problems @subsection NeXTStep Problems @@ -8369,7 +8398,7 @@ not enough.) @subsection Stack Overflow @cindex stack, overflow @cindex segmentation violation -@code{g77} code might fail at runtime (probably with a ``segmentation +@command{g77} code might fail at runtime (probably with a ``segmentation violation'') due to overflowing the stack. This happens most often on systems with an environment that provides substantially more heap space (for use @@ -8385,10 +8414,10 @@ Increasing the allowed stack size might, however, require changing some operating system or system configuration parameters. You might be able to work around the problem by compiling with the -@samp{-fno-automatic} option to reduce stack usage, probably at the +@option{-fno-automatic} option to reduce stack usage, probably at the expense of speed. -@code{g77}, on most machines, puts many variables and arrays on the stack +@command{g77}, on most machines, puts many variables and arrays on the stack where possible, and can be configured (by changing @code{FFECOM_sizeMAXSTACKITEM} in @file{@value{path-g77}/com.c}) to force smaller-sized entities into static storage (saving @@ -8415,12 +8444,12 @@ However, if your program uses large automatic arrays (for example, has declarations like @samp{REAL A(N)} where @samp{A} is a local array and @samp{N} is a dummy or @code{COMMON} variable that can have a large value), -neither use of @samp{-fno-automatic}, -nor changing the cut-off point for @code{g77} for using the stack, +neither use of @option{-fno-automatic}, +nor changing the cut-off point for @command{g77} for using the stack, will solve the problem by changing the placement of these large arrays, as they are @emph{necessarily} automatic. -@code{g77} currently provides no means to specify that +@command{g77} currently provides no means to specify that automatic arrays are to be allocated on the heap instead of the stack. So, other than increasing the stack size, your best bet is to @@ -8490,7 +8519,7 @@ The relevant UNIX commands to learn about include @cindex bus error @cindex overwritten data @cindex data, overwritten -@code{g77} code might fail at runtime with ``segmentation violation'', +@command{g77} code might fail at runtime with ``segmentation violation'', ``bus error'', or even something as subtle as a procedure call overwriting a variable or array element that it is not supposed to touch. @@ -8502,7 +8531,7 @@ themselves as @emph{visible} problems some time later. Overflowing the bounds of an array---usually by writing beyond the end of it---is one of two kinds of bug that often occurs in Fortran code. -(Compile your code with the @samp{-fbounds-check} option +(Compile your code with the @option{-fbounds-check} option to catch many of these kinds of errors at program run time.) The other kind of bug is a mismatch between the actual arguments @@ -8517,7 +8546,7 @@ That is, these bugs can be quite sensitive to data, including data representing the placement of other data in memory (that is, pointers, such as the placement of stack frames in memory). -@code{g77} now offers the +@command{g77} now offers the ability to catch and report some of these problems at compile, link, or run time, such as by generating code to detect references to beyond the bounds of most arrays (except assumed-size arrays), @@ -8555,18 +8584,18 @@ avoid picking up the @code{BSD} library from @file{/usr/ucblib}. @cindex inconsistent floating-point results @cindex results, inconsistent Some programs appear to produce inconsistent floating-point -results compiled by @code{g77} versus by other compilers. +results compiled by @command{g77} versus by other compilers. Often the reason for this behavior is the fact that floating-point values are represented on almost all Fortran systems by @emph{approximations}, and these approximations are inexact even for apparently simple values like 0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9, 1.1, and so on. -Most Fortran systems, including all current ports of @code{g77}, +Most Fortran systems, including all current ports of @command{g77}, use binary arithmetic to represent these approximations. Therefore, the exact value of any floating-point approximation -as manipulated by @code{g77}-compiled code is representable by +as manipulated by @command{g77}-compiled code is representable by adding some combination of the values 1.0, 0.5, 0.25, 0.125, and so on (just keep dividing by two) through the precision of the fraction (typically around 23 bits for @code{REAL(KIND=1)}, 52 for @@ -8606,13 +8635,13 @@ PRINT *, 0.2 END @end smallexample -When compiled by @code{g77}, the above program might output +When compiled by @command{g77}, the above program might output @samp{0.20000003}, while another compiler might produce a executable that outputs @samp{0.2}. This particular difference is due to the fact that, currently, conversion of floating-point values by the @code{libg2c} library, -used by @code{g77}, handles only double-precision values. +used by @command{g77}, handles only double-precision values. Since @samp{0.2} in the program is a single-precision value, it is converted to double precision (still in binary notation) @@ -8653,7 +8682,7 @@ PRINT *, 0.2D0 END @end smallexample -Future versions of @code{g77} and/or @code{libg2c} might convert +Future versions of @command{g77} and/or @code{libg2c} might convert single-precision values directly to decimal, instead of converting them to double precision first. This would tend to result in output that is more consistent @@ -8691,7 +8720,7 @@ as ``spills''. @cindex spills of floating-point results @cindex 80-bit spills @cindex truncation, of floating-point values -(@emph{Note:} @code{g77} specifically, and @code{gcc} generally, +(@emph{Note:} @command{g77} specifically, and @command{gcc} generally, does arbitrarily truncate 80-bit results during spills as of this writing. It is not yet clear whether a future version of @@ -8709,7 +8738,7 @@ documentation about this. @node Missing Features @section Missing Features -This section lists features we know are missing from @code{g77}, +This section lists features we know are missing from @command{g77}, and which we want to add someday. (There is no priority implied in the ordering below.) @@ -8781,7 +8810,7 @@ Debugging: @node Better Source Model @subsection Better Source Model -@code{g77} needs to provide, as the default source-line model, +@command{g77} needs to provide, as the default source-line model, a ``pure visual'' mode, where the interpretation of a source program in this mode can be accurately determined by a user looking at a traditionally displayed rendition @@ -8799,7 +8828,7 @@ to not treat lines with tabs as if they were infinitely long---instead, they would end at column 72 just as if the tabs were replaced by spaces in the canonical way. -As part of this, provide common alternate models (Digital, @code{f2c}, +As part of this, provide common alternate models (Digital, @command{f2c}, and so on) via command-line options. This includes allowing arbitrarily long lines for free-form source as well as fixed-form source and providing @@ -8807,7 +8836,7 @@ various limits and diagnostics as appropriate. @cindex sequence numbers @cindex columns 73 through 80 -Also, @code{g77} should offer, perhaps even default to, warnings +Also, @command{g77} should offer, perhaps even default to, warnings when characters beyond the last valid column are anything other than spaces. This would mean code with ``sequence numbers'' in columns 73 through 80 @@ -8816,14 +8845,14 @@ but one of the most frequent bugs encountered by new users is accidentally writing fixed-form source code into and beyond column 73. So, maybe the users of old code would be able to more easily handle -having to specify, say, a @samp{-Wno-col73to80} option. +having to specify, say, a @option{-Wno-col73to80} option. @node Fortran 90 Support @subsection Fortran 90 Support @cindex Fortran 90, support @cindex support, Fortran 90 -@code{g77} does not support many of the features that +@command{g77} does not support many of the features that distinguish Fortran 90 (and, now, Fortran 95) from ANSI FORTRAN 77. @@ -8831,14 +8860,14 @@ Some Fortran 90 features are supported, because they make sense to offer even to die-hard users of F77. For example, many of them codify various ways F77 has been extended to meet users' needs during its tenure, -so @code{g77} might as well offer them as the primary +so @command{g77} might as well offer them as the primary way to meet those same needs, even if it offers compatibility with one or more of the ways those needs were met by other F77 compilers in the industry. Still, many important F90 features are not supported, because no attempt has been made to research each and -every feature and assess its viability in @code{g77}. +every feature and assess its viability in @command{g77}. In the meantime, users who need those features must use Fortran 90 compilers anyway, and the best approach to adding some F90 features to GNU Fortran might well be @@ -8849,19 +8878,19 @@ to fund a comprehensive project to create GNU Fortran 95. @cindex PARAMETER statement @cindex statements, PARAMETER -@code{g77} doesn't allow intrinsics in @code{PARAMETER} statements. +@command{g77} doesn't allow intrinsics in @code{PARAMETER} statements. This feature is considered to be absolutely vital, even though it is not standard-conforming, and is scheduled for version 0.6. -Related to this, @code{g77} doesn't allow non-integral +Related to this, @command{g77} doesn't allow non-integral exponentiation in @code{PARAMETER} statements, such as @samp{PARAMETER (R=2**.25)}. -It is unlikely @code{g77} will ever support this feature, +It is unlikely @command{g77} will ever support this feature, as doing it properly requires complete emulation of a target computer's floating-point facilities when -building @code{g77} as a cross-compiler. -But, if the @code{gcc} back end is enhanced to provide -such a facility, @code{g77} will likely use that facility +building @command{g77} as a cross-compiler. +But, if the @command{gcc} back end is enhanced to provide +such a facility, @command{g77} will likely use that facility in implementing this feature soon afterwards. @node Arbitrary Concatenation @@ -8870,7 +8899,7 @@ in implementing this feature soon afterwards. @cindex CHARACTER*(*) @cindex run-time, dynamic allocation -@code{g77} doesn't support arbitrary operands for concatenation +@command{g77} doesn't support arbitrary operands for concatenation in contexts where run-time allocation is required. For example: @@ -8893,7 +8922,7 @@ are not supported. @cindex recursion, lack of @cindex lack of recursion -@code{g77} doesn't support the @code{RECURSIVE} keyword that +@command{g77} doesn't support the @code{RECURSIVE} keyword that F90 compilers do. Nor does it provide any means for compiling procedures designed to do recursion. @@ -8914,27 +8943,27 @@ but the result is not pretty. @cindex Toolpack @cindex Netlib -Some compilers, such as @code{f2c}, have an option (@samp{-r8}, -@samp{-qrealsize=8} or +Some compilers, such as @command{f2c}, have an option (@option{-r8}, +@option{-qrealsize=8} or similar) that provides automatic treatment of @code{REAL} entities such that they have twice the storage size, and a corresponding increase in the range and precision, of what would normally be the @code{REAL(KIND=1)} (default @code{REAL}) type. (This affects @code{COMPLEX} the same way.) -They also typically offer another option (@samp{-i8}) to increase +They also typically offer another option (@option{-i8}) to increase @code{INTEGER} entities so they are twice as large (with roughly twice as much range). (There are potential pitfalls in using these options.) -@code{g77} does not yet offer any option that performs these +@command{g77} does not yet offer any option that performs these kinds of transformations. Part of the problem is the lack of detailed specifications regarding exactly how these options affect the interpretation of constants, intrinsics, and so on. -Until @code{g77} addresses this need, programmers could improve +Until @command{g77} addresses this need, programmers could improve the portability of their code by modifying it to not require compile-time options to produce correct results. Some free tools are available which may help, specifically @@ -8953,7 +8982,7 @@ alleviate this problem). @cindex @code{LOGICAL*1} support @cindex types, @code{LOGICAL*1} -@code{g77} doesn't fully support @code{INTEGER*2}, @code{LOGICAL*1}, +@command{g77} doesn't fully support @code{INTEGER*2}, @code{LOGICAL*1}, and similar. Version 0.6 will provide full support for this very popular set of features. @@ -8967,7 +8996,7 @@ for them. @cindex types, @code{REAL*16} @cindex @code{INTEGER*8} support @cindex types, @code{INTEGER*8} -@code{g77} doesn't support @code{INTEGER}, @code{REAL}, and @code{COMPLEX} equivalents +@command{g77} doesn't support @code{INTEGER}, @code{REAL}, and @code{COMPLEX} equivalents for @emph{all} applicable back-end-supported types (@code{char}, @code{short int}, @code{int}, @code{long int}, @code{long long int}, and @code{long double}). This means providing intrinsic support, and maybe constant @@ -8985,11 +9014,11 @@ This is scheduled for version 0.6. @cindex @code{DIMENSION} statement @cindex statements, @code{DIMENSION} -@code{g77} doesn't support more general expressions to dimension +@command{g77} doesn't support more general expressions to dimension arrays, such as array element references, function references, etc. -For example, @code{g77} currently does not accept the following: +For example, @command{g77} currently does not accept the following: @smallexample SUBROUTINE X(M, N) @@ -9002,19 +9031,19 @@ INTEGER N(10), M(N(2), N(1)) @cindex statements, POINTER @cindex Cray pointers -@code{g77} doesn't support pointers or allocatable objects +@command{g77} doesn't support pointers or allocatable objects (other than automatic arrays). This set of features is probably considered just behind intrinsics in @code{PARAMETER} statements on the list of large, -important things to add to @code{g77}. +important things to add to @command{g77}. In the meantime, consider using the @code{INTEGER(KIND=7)} declaration to specify that a variable must be able to hold a pointer. This construct is not portable to other non-GNU compilers, but it is portable to all machines GNU Fortran supports -when @code{g77} is used. +when @command{g77} is used. @xref{Functions and Subroutines}, for information on @code{%VAL()}, @code{%REF()}, and @code{%DESCR()} @@ -9024,14 +9053,14 @@ procedures written in languages other than Fortran. @node Sensible Non-standard Constructs @subsection Sensible Non-standard Constructs -@code{g77} rejects things other compilers accept, +@command{g77} rejects things other compilers accept, like @samp{INTRINSIC SQRT,SQRT}. As time permits in the future, some of these things that are easy for humans to read and write and unlikely to be intended to mean something -else will be accepted by @code{g77} (though @samp{-fpedantic} should +else will be accepted by @command{g77} (though @option{-fpedantic} should trigger warnings about such non-standard constructs). -Until @code{g77} no longer gratuitously rejects sensible code, +Until @command{g77} no longer gratuitously rejects sensible code, you might as well fix your code to be more standard-conforming and portable. @@ -9054,18 +9083,18 @@ from also specifying the @code{SAVE} statement, by itself, to indicate that all local variables and arrays are to have the @code{SAVE} attribute. -For this reason, @code{g77} already has been changed to +For this reason, @command{g77} already has been changed to allow this combination, because although the general problem of gratuitously rejecting unambiguous and -``safe'' constructs still exists in @code{g77}, this +``safe'' constructs still exists in @command{g77}, this particular construct was deemed useful enough that -it was worth fixing @code{g77} for just this case. +it was worth fixing @command{g77} for just this case. So, while there is no need to change your code to avoid using this particular construct, there might be other, equally appropriate but non-standard constructs, that you shouldn't have to stop using -just because @code{g77} (or any other compiler) +just because @command{g77} (or any other compiler) gratuitously rejects it. Until the general problem is solved, if you have @@ -9073,7 +9102,7 @@ any such construct you believe is worthwhile using (e.g. not just an arbitrary, redundant specification of an attribute), please submit a bug report with an explanation, so we can consider -fixing @code{g77} just for cases like yours. +fixing @command{g77} just for cases like yours. @node READONLY Keyword @subsection @code{READONLY} Keyword @@ -9088,12 +9117,12 @@ and perhaps to trigger a fatal diagnostic if a @code{WRITE} or @code{PRINT} to such a unit is attempted. -@emph{Note:} It is not sufficient for @code{g77} and @code{libg2c} +@emph{Note:} It is not sufficient for @command{g77} and @code{libg2c} (its version of @code{libf2c}) to assume that @code{READONLY} does not need some kind of explicit support at run time, due to UNIX systems not (generally) needing it. -@code{g77} is not just a UNIX-based compiler! +@command{g77} is not just a UNIX-based compiler! Further, mounting of non-UNIX filesystems on UNIX systems (such as via NFS) @@ -9106,7 +9135,7 @@ keyword.) @node FLUSH Statement @subsection @code{FLUSH} Statement -@code{g77} could perhaps use a @code{FLUSH} statement that +@command{g77} could perhaps use a @code{FLUSH} statement that does what @samp{CALL FLUSH} does, but that supports @samp{*} as the unit designator (same unit as for @code{PRINT}) and accepts @code{ERR=} and/or @code{IOSTAT=} @@ -9117,11 +9146,11 @@ specifiers. @cindex FORMAT statement @cindex statements, FORMAT -@code{g77} doesn't support @samp{FORMAT(I<J>)} and the like. +@command{g77} doesn't support @samp{FORMAT(I<J>)} and the like. Supporting this requires a significant redesign or replacement of @code{libg2c}. -However, @code{g77} does support +However, @command{g77} does support this construct when the expression is constant (as of version 0.5.22). For example: @@ -9158,7 +9187,7 @@ when @code{ERR=} and @code{END=} constructs are employed: @node Explicit Assembler Code @subsection Explicit Assembler Code -@code{g77} needs to provide some way, a la @code{gcc}, for @code{g77} +@command{g77} needs to provide some way, a la @command{gcc}, for @command{g77} code to specify explicit assembler code. @node Q Edit Descriptor @@ -9180,7 +9209,7 @@ A workaround might be using internal I/O or the stream-based intrinsics. @cindex PARAMETER statement @cindex statements, PARAMETER -@code{g77} doesn't accept @samp{PARAMETER I=1}. +@command{g77} doesn't accept @samp{PARAMETER I=1}. Supporting this obsolete form of the @code{PARAMETER} statement would not be particularly hard, as most of the parsing code is already in place and working. @@ -9200,7 +9229,7 @@ assigned to it). @cindex ACCEPT statement @cindex statements, ACCEPT -@code{g77} doesn't support the I/O statements @code{TYPE} and +@command{g77} doesn't support the I/O statements @code{TYPE} and @code{ACCEPT}. These are common extensions that should be easy to support, but also are fairly easy to work around in user code. @@ -9221,10 +9250,10 @@ replaced by @samp{READ fmt,list}. @cindex MAP statement @cindex statements, MAP -@code{g77} doesn't support @code{STRUCTURE}, @code{UNION}, @code{RECORD}, +@command{g77} doesn't support @code{STRUCTURE}, @code{UNION}, @code{RECORD}, @code{MAP}. This set of extensions is quite a bit -lower on the list of large, important things to add to @code{g77}, partly +lower on the list of large, important things to add to @command{g77}, partly because it requires a great deal of work either upgrading or replacing @code{libg2c}. @@ -9238,9 +9267,9 @@ replacing @code{libg2c}. @cindex INQUIRE statement @cindex statements, INQUIRE -@code{g77} doesn't have support for keywords such as @code{DISP='DELETE'} in +@command{g77} doesn't have support for keywords such as @code{DISP='DELETE'} in the @code{OPEN}, @code{CLOSE}, and @code{INQUIRE} statements. -These extensions are easy to add to @code{g77} itself, but +These extensions are easy to add to @command{g77} itself, but require much more work on @code{libg2c}. @cindex FORM='PRINT' @@ -9248,7 +9277,7 @@ require much more work on @code{libg2c}. @cindex carriage control @pindex asa @pindex fpr -@code{g77} doesn't support @code{FORM='PRINT'} or an equivalent to +@command{g77} doesn't support @code{FORM='PRINT'} or an equivalent to translate the traditional `carriage control' characters in column 1 of output to use backspaces, carriage returns and the like. However programs exist to translate them in output files (or standard output). @@ -9270,7 +9299,7 @@ sites. @cindex DECODE statement @cindex statements, DECODE -@code{g77} doesn't support @code{ENCODE} or @code{DECODE}. +@command{g77} doesn't support @code{ENCODE} or @code{DECODE}. These statements are best replaced by READ and WRITE statements involving internal files (CHARACTER variables and arrays). @@ -9318,7 +9347,7 @@ with: @end smallexample It is entirely possible that @code{ENCODE} and @code{DECODE} will -be supported by a future version of @code{g77}. +be supported by a future version of @command{g77}. @node AUTOMATIC Statement @subsection @code{AUTOMATIC} Statement @@ -9327,13 +9356,13 @@ be supported by a future version of @code{g77}. @cindex automatic variables @cindex variables, automatic -@code{g77} doesn't support the @code{AUTOMATIC} statement that -@code{f2c} does. +@command{g77} doesn't support the @code{AUTOMATIC} statement that +@command{f2c} does. @code{AUTOMATIC} would identify a variable or array as not being @code{SAVE}'d, which is normally the default, but which would be especially useful for code that, @emph{generally}, -needed to be compiled with the @samp{-fno-automatic} option. +needed to be compiled with the @option{-fno-automatic} option. @code{AUTOMATIC} also would serve as a hint to the compiler that placing the variable or array---even a very large array--on the stack is acceptable. @@ -9361,7 +9390,7 @@ should be provided as well. @node Suppressing Space Padding @subsection Suppressing Space Padding of Source Lines -@code{g77} should offer VXT-Fortran-style suppression of virtual +@command{g77} should offer VXT-Fortran-style suppression of virtual spaces at the end of a source line if an appropriate command-line option is specified. @@ -9375,7 +9404,7 @@ source file, as in the following example: @end smallexample @noindent -@code{g77}, and many other compilers, virtually extend +@command{g77}, and many other compilers, virtually extend the continued line through column 72 with spaces that become part of the character constant, but Digital Fortran normally didn't, leaving only one space between @samp{MANY} and @samp{SPACES?} @@ -9387,13 +9416,13 @@ command-line option is specified, apparently due to demand from readers of the USENET group @file{comp.lang.fortran} to offer conformance to this widespread practice in the industry. -@code{g77} should return the favor by offering conformance +@command{g77} should return the favor by offering conformance to Digital's approach to handling the above example. @node Fortran Preprocessor @subsection Fortran Preprocessor -@code{g77} should offer a preprocessor designed specifically +@command{g77} should offer a preprocessor designed specifically for Fortran to replace @samp{cpp -traditional}. There are several out there worth evaluating, at least. @@ -9411,10 +9440,10 @@ files included via the @code{INCLUDE} directive. @cindex @code{Shift} intrinsic @cindex intrinsics, @code{Shift} -@code{g77} does not allow @code{REAL} and other non-integral types for +@command{g77} does not allow @code{REAL} and other non-integral types for arguments to intrinsics like @code{And}, @code{Or}, and @code{Shift}. -For example, this program is rejected by @code{g77}, because +For example, this program is rejected by @command{g77}, because the intrinsic @code{Iand} does not accept @code{REAL} arguments: @smallexample @@ -9426,7 +9455,7 @@ END @node Really Ugly Character Assignments @subsection Really Ugly Character Assignments -An option such as @samp{-fugly-char} should be provided +An option such as @option{-fugly-char} should be provided to allow @smallexample @@ -9444,7 +9473,7 @@ A1 = 'ABCDEFGH' @node POSIX Standard @subsection @code{POSIX} Standard -@code{g77} should support the POSIX standard for Fortran. +@command{g77} should support the POSIX standard for Fortran. @node Floating-point Exception Handling @subsection Floating-point Exception Handling @@ -9453,7 +9482,7 @@ A1 = 'ABCDEFGH' @cindex FPE handling @cindex NaN values -The @code{gcc} backend and, consequently, @code{g77}, currently provides no +The @command{gcc} backend and, consequently, @command{g77}, currently provides no general control over whether or not floating-point exceptions are trapped or ignored. (Ignoring them typically results in NaN values being @@ -9463,7 +9492,7 @@ code, though some targets, such as the Alpha, have code generation options which change the behaviour. Most systems provide some C-callable mechanism to change this; this can -be invoked at startup using @code{gcc}'s @code{constructor} attribute. +be invoked at startup using @command{gcc}'s @code{constructor} attribute. For example, just compiling and linking the following C code with your program will turn on exception trapping for the ``common'' exceptions on a GNU system using glibc 2.2 or newer: @@ -9484,7 +9513,7 @@ A convenient trick is to compile this something like: @smallexample gcc -o libtrapfpe.a trapfpe.c @end smallexample -and then use it by adding @samp{-trapfpe} to the @code{g77} command line +and then use it by adding @option{-trapfpe} to the @command{g77} command line when linking. @node Nonportable Conversions @@ -9492,14 +9521,14 @@ when linking. @cindex nonportable conversions @cindex conversions, nonportable -@code{g77} doesn't accept some particularly nonportable, +@command{g77} doesn't accept some particularly nonportable, silent data-type conversions such as @code{LOGICAL} to @code{REAL} (as in @samp{A=.FALSE.}, where @samp{A} is type @code{REAL}), that other compilers might quietly accept. -Some of these conversions are accepted by @code{g77} -when the @samp{-fugly-logint} option is specified. +Some of these conversions are accepted by @command{g77} +when the @option{-fugly-logint} option is specified. Perhaps it should accept more or all of them. @node Large Automatic Arrays @@ -9509,7 +9538,7 @@ Perhaps it should accept more or all of them. Currently, automatic arrays always are allocated on the stack. For situations where the stack cannot be made large enough, -@code{g77} should offer a compiler option that specifies +@command{g77} should offer a compiler option that specifies allocation of automatic arrays in heap storage. @node Support for Threads @@ -9517,8 +9546,8 @@ allocation of automatic arrays in heap storage. @cindex threads @cindex parallel processing -Neither the code produced by @code{g77} nor the @code{libg2c} library -are thread-safe, nor does @code{g77} have support for parallel processing +Neither the code produced by @command{g77} nor the @code{libg2c} library +are thread-safe, nor does @command{g77} have support for parallel processing (other than the instruction-level parallelism available on some processors). A package such as PVM might help here. @@ -9528,7 +9557,7 @@ A package such as PVM might help here. @cindex debug line @cindex comment line, debug -An option such as @samp{-fdebug-lines} should be provided +An option such as @option{-fdebug-lines} should be provided to turn fixed-form lines beginning with @samp{D} to be treated as if they began with a space, instead of as if they began with a @samp{C} @@ -9537,7 +9566,7 @@ instead of as if they began with a @samp{C} @node Better Warnings @subsection Better Warnings -Because of how @code{g77} generates code via the back end, +Because of how @command{g77} generates code via the back end, it doesn't always provide warnings the user wants. Consider: @@ -9549,7 +9578,7 @@ END Currently, the above is not flagged as a case of using an uninitialized variable, -because @code{g77} generates a run-time library call that looks, +because @command{g77} generates a run-time library call that looks, to the GBE, like it might actually @emph{modify} @samp{A} at run time. (And, in fact, depending on the previous run-time library call, it would!) @@ -9568,7 +9597,7 @@ at least theoretically, and, ultimately, in practice, for some types of code. @item -Have @code{g77} pass a pointer to a temporary +Have @command{g77} pass a pointer to a temporary containing a copy of @samp{A}, instead of to @samp{A} itself. The GBE would then complain about the copy operation @@ -9579,21 +9608,21 @@ because @samp{A} might then end up living in a register, which could help with inner loops. @item -Have @code{g77} use a GBE construct similar to @code{ADDR_EXPR} +Have @command{g77} use a GBE construct similar to @code{ADDR_EXPR} but with extra information on the fact that the item pointed to won't be modified (a la @code{const} in C). Probably the best solution for now, but not quite trivial to implement in the general case. -Worth considering after @code{g77} 0.6 is considered +Worth considering after @command{g77} 0.6 is considered pretty solid. @end itemize @node Gracefully Handle Sensible Bad Code @subsection Gracefully Handle Sensible Bad Code -@code{g77} generally should continue processing for +@command{g77} generally should continue processing for warnings and recoverable (user) errors whenever possible---that is, it shouldn't gratuitously make bad or useless code. @@ -9606,8 +9635,8 @@ END @end smallexample @noindent -When compiling the above with @samp{-ff2c-intrinsics-disable}, -@code{g77} should indeed complain about passing @code{ZABS}, +When compiling the above with @option{-ff2c-intrinsics-disable}, +@command{g77} should indeed complain about passing @code{ZABS}, but it still should compile, instead of rejecting the entire @code{CALL} statement. (Some of this is related to improving @@ -9616,14 +9645,14 @@ the compiler internals to improve how statements are analyzed.) @node Non-standard Conversions @subsection Non-standard Conversions -@samp{-Wconversion} and related should flag places where non-standard +@option{-Wconversion} and related should flag places where non-standard conversions are found. -Perhaps much of this would be part of @samp{-Wugly*}. +Perhaps much of this would be part of @option{-Wugly*}. @node Non-standard Intrinsics @subsection Non-standard Intrinsics -@code{g77} needs a new option, like @samp{-Wintrinsics}, to warn about use of +@command{g77} needs a new option, like @option{-Wintrinsics}, to warn about use of non-standard intrinsics without explicit @code{INTRINSIC} statements for them. This would help find code that might fail silently when ported to another compiler. @@ -9631,14 +9660,14 @@ compiler. @node Modifying DO Variable @subsection Modifying @code{DO} Variable -@code{g77} should warn about modifying @code{DO} variables +@command{g77} should warn about modifying @code{DO} variables via @code{EQUIVALENCE}. (The internal information gathered to produce this warning might also be useful in setting the internal ``doiter'' flag for a variable or even array reference within a loop, since that might produce faster code someday.) -For example, this code is invalid, so @code{g77} should warn about +For example, this code is invalid, so @command{g77} should warn about the invalid assignment to @samp{NOTHER}: @smallexample @@ -9651,7 +9680,7 @@ END DO @node Better Pedantic Compilation @subsection Better Pedantic Compilation -@code{g77} needs to support @samp{-fpedantic} more thoroughly, +@command{g77} needs to support @option{-fpedantic} more thoroughly, and use it only to generate warnings instead of rejecting constructs outright. Have it warn: @@ -9664,7 +9693,7 @@ syntactic extensions. @node Warn About Implicit Conversions @subsection Warn About Implicit Conversions -@code{g77} needs a @samp{-Wpromotions} option to warn if source code appears +@command{g77} needs a @option{-Wpromotions} option to warn if source code appears to expect automatic, silent, and somewhat dangerous compiler-assisted conversion of @code{REAL(KIND=1)} constants to @code{REAL(KIND=2)} based on context. @@ -9680,7 +9709,7 @@ FOO = TZPHI * 3D0 @node Invalid Use of Hollerith Constant @subsection Invalid Use of Hollerith Constant -@code{g77} should disallow statements like @samp{RETURN 2HAB}, +@command{g77} should disallow statements like @samp{RETURN 2HAB}, which are invalid in both source forms (unlike @samp{RETURN (2HAB)}, which probably still makes no sense but at least can @@ -9691,17 +9720,17 @@ in a way that is a bit difficult to understand. @node Dummy Array Without Dimensioning Dummy @subsection Dummy Array Without Dimensioning Dummy -@code{g77} should complain when a list of dummy arguments containing an +@command{g77} should complain when a list of dummy arguments containing an adjustable dummy array does not also contain every variable listed in the dimension list of the adjustable array. -Currently, @code{g77} does complain about a variable that +Currently, @command{g77} does complain about a variable that dimensions an array but doesn't appear in any dummy list or @code{COMMON} area, but this needs to be extended to catch cases where it doesn't appear in every dummy list that also lists any arrays it dimensions. -For example, @code{g77} should warn about the entry point @samp{ALT} +For example, @command{g77} should warn about the entry point @samp{ALT} below, since it includes @samp{ARRAY} but not @samp{ISIZE} in its list of arguments: @@ -9714,7 +9743,7 @@ ENTRY ALT(ARRAY) @node Invalid FORMAT Specifiers @subsection Invalid FORMAT Specifiers -@code{g77} should check @code{FORMAT} specifiers for validity +@command{g77} should check @code{FORMAT} specifiers for validity as it does @code{FORMAT} statements. For example, a diagnostic would be produced for: @@ -9726,8 +9755,8 @@ PRINT 'HI THERE!' !User meant PRINT *, 'HI THERE!' @node Ambiguous Dialects @subsection Ambiguous Dialects -@code{g77} needs a set of options such as @samp{-Wugly*}, @samp{-Wautomatic}, -@samp{-Wvxt}, @samp{-Wf90}, and so on. +@command{g77} needs a set of options such as @option{-Wugly*}, @option{-Wautomatic}, +@option{-Wvxt}, @option{-Wf90}, and so on. These would warn about places in the user's source where ambiguities are found, helpful in resolving ambiguities in the program's dialect or dialects. @@ -9735,13 +9764,13 @@ dialect or dialects. @node Unused Labels @subsection Unused Labels -@code{g77} should warn about unused labels when @samp{-Wunused} is in effect. +@command{g77} should warn about unused labels when @option{-Wunused} is in effect. @node Informational Messages @subsection Informational Messages -@code{g77} needs an option to suppress information messages (notes). -@samp{-w} does this but also suppresses warnings. +@command{g77} needs an option to suppress information messages (notes). +@option{-w} does this but also suppresses warnings. The default should be to suppress info messages. Perhaps info messages should simply be eliminated. @@ -9749,7 +9778,7 @@ Perhaps info messages should simply be eliminated. @node Uninitialized Variables at Run Time @subsection Uninitialized Variables at Run Time -@code{g77} needs an option to initialize everything (not otherwise +@command{g77} needs an option to initialize everything (not otherwise explicitly initialized) to ``weird'' (machine-dependent) values, e.g. NaNs, bad (non-@code{NULL}) pointers, and largest-magnitude integers, would help track down references to @@ -9765,19 +9794,19 @@ many such bugs at compile time. @cindex file formats @cindex binary data @cindex byte ordering -@code{g77} has no facility for exchanging unformatted files with systems +@command{g77} has no facility for exchanging unformatted files with systems using different number formats---even differing only in endianness (byte order)---or written by other compilers. Some compilers provide facilities at least for doing byte-swapping during unformatted I/O. It is unrealistic to expect to cope with exchanging unformatted files -with arbitrary other compiler runtimes, but the @code{g77} runtime -should at least be able to read files written by @code{g77} on systems +with arbitrary other compiler runtimes, but the @command{g77} runtime +should at least be able to read files written by @command{g77} on systems with different number formats, particularly if they differ only in byte order. In case you do need to write a program to translate to or from -@code{g77} (@code{libf2c}) unformatted files, they are written as +@command{g77} (@code{libf2c}) unformatted files, they are written as follows: @table @asis @item Sequential @@ -9810,9 +9839,9 @@ between big- and little-endian 32-bit systems using IEEE 754 floating point it would be sufficient to reverse the bytes in consecutive words in the file if, and @emph{only} if, only @code{REAL*4}, @code{COMPLEX}, @code{INTEGER*4} and/or @code{LOGICAL*4} data have been written to it by -@code{g77}. +@command{g77}. -If necessary, it is possible to do byte-oriented i/o with @code{g77}'s +If necessary, it is possible to do byte-oriented i/o with @command{g77}'s @code{FGETC} and @code{FPUTC} intrinsics. Byte-swapping can be done in Fortran by equivalencing larger sized variables to an @code{INTEGER*1} array or a set of scalars. @@ -9826,7 +9855,7 @@ or PACT's PDB@footnote{No, not @emph{that} one.} (@uref{http://www.llnl.gov/def_sci/pact/pact_homepage.html}). (Unlike, say, CDF or XDR, HDF-like systems write in the native number formats and only incur overhead when they are read on a system with a different -format.) A future @code{g77} runtime library should use such +format.) A future @command{g77} runtime library should use such techniques. @node Better List-directed I/O @@ -9846,7 +9875,7 @@ to be undertaken. In the meantime, use of formatted I/O is recommended. While it might be of little consolation, -@code{g77} does support @samp{FORMAT(F<WIDTH>.4)}, for example, +@command{g77} does support @samp{FORMAT(F<WIDTH>.4)}, for example, as long as @samp{WIDTH} is defined as a named constant (via @code{PARAMETER}). That at least allows some compile-time specification @@ -9875,7 +9904,7 @@ This change probably requires the @code{libg77} project. @node Labels Visible to Debugger @subsection Labels Visible to Debugger -@code{g77} should output debugging information for statements labels, +@command{g77} should output debugging information for statements labels, for use by debuggers that know how to support them. Same with weirder things like construct names. It is not yet known if any debug formats or debuggers support these. @@ -9924,29 +9953,29 @@ with popular existing compilers. @cindex statements, @code{COMMON} @cindex naming conflicts -@code{g77} doesn't allow a common block and an external procedure or +@command{g77} doesn't allow a common block and an external procedure or @code{BLOCK DATA} to have the same name. -Some systems allow this, but @code{g77} does not, -to be compatible with @code{f2c}. +Some systems allow this, but @command{g77} does not, +to be compatible with @command{f2c}. -@code{g77} could special-case the way it handles -@code{BLOCK DATA}, since it is not compatible with @code{f2c} in this -particular area (necessarily, since @code{g77} offers an +@command{g77} could special-case the way it handles +@code{BLOCK DATA}, since it is not compatible with @command{f2c} in this +particular area (necessarily, since @command{g77} offers an important feature here), but it is likely that such special-casing would be very annoying to people with programs that use @samp{EXTERNAL FOO}, with no other mention of @samp{FOO} in the same program unit, to refer to external procedures, since -the result would be that @code{g77} would treat these references as requests to +the result would be that @command{g77} would treat these references as requests to force-load BLOCK DATA program units. -In that case, if @code{g77} modified +In that case, if @command{g77} modified names of @code{BLOCK DATA} so they could have the same names as @code{COMMON}, users would find that their programs wouldn't link because the @samp{FOO} procedure didn't have its name translated the same way. (Strictly speaking, -@code{g77} could emit a null-but-externally-satisfying definition of +@command{g77} could emit a null-but-externally-satisfying definition of @samp{FOO} with its name transformed as if it had been a @code{BLOCK DATA}, but that probably invites more trouble than it's worth.) @@ -9956,7 +9985,7 @@ worth.) @cindex IMPLICIT CHARACTER*(*) statement @cindex statements, IMPLICIT CHARACTER*(*) -@code{g77} disallows @code{IMPLICIT CHARACTER*(*)}. +@command{g77} disallows @code{IMPLICIT CHARACTER*(*)}. This is not standard-conforming. @node Non-bugs @@ -9987,15 +10016,15 @@ we do not make because we think GNU Fortran is better without them. @cindex support, @code{f77} In the opinion of many experienced Fortran users, -@samp{-fno-backslash} should be the default, not @samp{-fbackslash}, -as currently set by @code{g77}. +@option{-fno-backslash} should be the default, not @option{-fbackslash}, +as currently set by @command{g77}. First of all, you can always specify -@samp{-fno-backslash} to turn off this processing. +@option{-fno-backslash} to turn off this processing. Despite not being within the spirit (though apparently within the -letter) of the ANSI FORTRAN 77 standard, @code{g77} defaults to -@samp{-fbackslash} because that is what most UNIX @code{f77} commands +letter) of the ANSI FORTRAN 77 standard, @command{g77} defaults to +@option{-fbackslash} because that is what most UNIX @code{f77} commands default to, and apparently lots of code depends on this feature. This is a particularly troubling issue. @@ -10003,31 +10032,31 @@ The use of a C construct in the midst of Fortran code is bad enough, worse when it makes existing Fortran programs stop working (as happens when programs written for non-UNIX systems are ported to UNIX systems with -compilers that provide the @samp{-fbackslash} feature +compilers that provide the @option{-fbackslash} feature as the default---sometimes with no option to turn it off). The author of GNU Fortran wished, for reasons of linguistic -purity, to make @samp{-fno-backslash} the default for GNU -Fortran and thus require users of UNIX @code{f77} and @code{f2c} -to specify @samp{-fbackslash} to get the UNIX behavior. +purity, to make @option{-fno-backslash} the default for GNU +Fortran and thus require users of UNIX @code{f77} and @command{f2c} +to specify @option{-fbackslash} to get the UNIX behavior. -However, the realization that @code{g77} is intended as +However, the realization that @command{g77} is intended as a replacement for @emph{UNIX} @code{f77}, caused the author -to choose to make @code{g77} as compatible with -@code{f77} as feasible, which meant making @samp{-fbackslash} +to choose to make @command{g77} as compatible with +@code{f77} as feasible, which meant making @option{-fbackslash} the default. The primary focus on compatibility is at the source-code level, and the question became ``What will users expect a replacement for @code{f77} to do, by default?'' Although at least one UNIX @code{f77} does not provide -@samp{-fbackslash} as a default, it appears that +@option{-fbackslash} as a default, it appears that the majority of them do, which suggests that the majority of code that is compiled by UNIX @code{f77} -compilers expects @samp{-fbackslash} to be the default. +compilers expects @option{-fbackslash} to be the default. It is probably the case that more code exists -that would @emph{not} work with @samp{-fbackslash} +that would @emph{not} work with @option{-fbackslash} in force than code that requires it be in force. However, most of @emph{that} code is not being compiled @@ -10037,15 +10066,15 @@ makefiles, and so on) must be set up anyway so that they work under UNIX. That makes a much more natural and safe opportunity for non-UNIX users to adapt their build procedures for -@code{g77}'s default of @samp{-fbackslash} than would +@command{g77}'s default of @option{-fbackslash} than would exist for the majority of UNIX @code{f77} users who would have to modify existing, working build procedures -to explicitly specify @samp{-fbackslash} if that was +to explicitly specify @option{-fbackslash} if that was not the default. One suggestion has been to configure the default for -@samp{-fbackslash} (and perhaps other options as well) -based on the configuration of @code{g77}. +@option{-fbackslash} (and perhaps other options as well) +based on the configuration of @command{g77}. This is technically quite straightforward, but will be avoided even in cases where not configuring defaults to be @@ -10067,11 +10096,11 @@ But such applications are rare. And users writing a program to run on more than one type of machine cannot possibly benefit from this kind of compatibility. -(This is consistent with the design goals for @code{gcc}. -To change them for @code{g77}, you must first change them -for @code{gcc}. -Do not ask the maintainers of @code{g77} to do this for you, -or to disassociate @code{g77} from the widely understood, if +(This is consistent with the design goals for @command{gcc}. +To change them for @command{g77}, you must first change them +for @command{gcc}. +Do not ask the maintainers of @command{g77} to do this for you, +or to disassociate @command{g77} from the widely understood, if not widely agreed-upon, goals for GNU compilers in general.) This is why GNU Fortran does and will treat backslashes in the same @@ -10110,20 +10139,20 @@ be used instead, for readability.) @cindex initialization, statement placement @cindex placing initialization statements -@code{g77} does not allow @samp{DATA VAR/1/} to appear in the +@command{g77} does not allow @samp{DATA VAR/1/} to appear in the source code before @samp{COMMON VAR}, @samp{DIMENSION VAR(10)}, @samp{INTEGER VAR}, and so on. -In general, @code{g77} requires initialization of a variable +In general, @command{g77} requires initialization of a variable or array to be specified @emph{after} all other specifications of attributes (type, size, placement, and so on) of that variable or array are specified (though @emph{confirmation} of data type is permitted). -It is @emph{possible} @code{g77} will someday allow all of this, +It is @emph{possible} @command{g77} will someday allow all of this, even though it is not allowed by the FORTRAN 77 standard. Then again, maybe it is better to have -@code{g77} always require placement of @code{DATA} +@command{g77} always require placement of @code{DATA} so that it can possibly immediately write constants to the output file, thus saving time and space. @@ -10137,42 +10166,42 @@ and to do this it cannot be followed by @samp{COMMON A}. @cindex intrinsics, context-sensitive @cindex context-sensitive intrinsics -@code{g77} treats procedure references to @emph{possible} intrinsic +@command{g77} treats procedure references to @emph{possible} intrinsic names as always enabling their intrinsic nature, regardless of whether the @emph{form} of the reference is valid for that intrinsic. -For example, @samp{CALL SQRT} is interpreted by @code{g77} as +For example, @samp{CALL SQRT} is interpreted by @command{g77} as an invalid reference to the @code{SQRT} intrinsic function, because the reference is a subroutine invocation. -First, @code{g77} recognizes the statement @samp{CALL SQRT} +First, @command{g77} recognizes the statement @samp{CALL SQRT} as a reference to a @emph{procedure} named @samp{SQRT}, not to a @emph{variable} with that name (as it would for a statement such as @samp{V = SQRT}). -Next, @code{g77} establishes that, in the program unit being compiled, +Next, @command{g77} establishes that, in the program unit being compiled, @code{SQRT} is an intrinsic---not a subroutine that happens to have the same name as an intrinsic (as would be the case if, for example, @samp{EXTERNAL SQRT} was present). -Finally, @code{g77} recognizes that the @emph{form} of the +Finally, @command{g77} recognizes that the @emph{form} of the reference is invalid for that particular intrinsic. That is, it recognizes that it is invalid for an intrinsic @emph{function}, such as @code{SQRT}, to be invoked as a @emph{subroutine}. -At that point, @code{g77} issues a diagnostic. +At that point, @command{g77} issues a diagnostic. Some users claim that it is ``obvious'' that @samp{CALL SQRT} references an external subroutine of their own, not an intrinsic function. -However, @code{g77} knows about intrinsic +However, @command{g77} knows about intrinsic subroutines, not just functions, and is able to support both having the same names, for example. -As a result of this, @code{g77} rejects calls +As a result of this, @command{g77} rejects calls to intrinsics that are not subroutines, and function invocations of intrinsics that are not functions, just as it (and most compilers) rejects invocations of intrinsics with the wrong number (or types) @@ -10186,7 +10215,7 @@ a user-written subroutine named @samp{SQRT}. @cindex constants, context-sensitive @cindex context-sensitive constants -@code{g77} does not use context to determine the types of +@command{g77} does not use context to determine the types of constants or named constants (@code{PARAMETER}), except for (non-standard) typeless constants such as @samp{'123'O}. @@ -10197,12 +10226,12 @@ PRINT *, 9.435784839284958 * 2D0 @end smallexample @noindent -@code{g77} will interpret the (truncated) constant +@command{g77} will interpret the (truncated) constant @samp{9.435784839284958} as a @code{REAL(KIND=1)}, not @code{REAL(KIND=2)}, constant, because the suffix @code{D0} is not specified. As a result, the output of the above statement when -compiled by @code{g77} will appear to have ``less precision'' +compiled by @command{g77} will appear to have ``less precision'' than when compiled by other compilers. In these and other cases, some compilers detect the @@ -10235,7 +10264,7 @@ END Running the above program should result in the same value being printed three times. -With @code{g77} as the compiler, +With @command{g77} as the compiler, it does. However, compiled by many other compilers, @@ -10259,14 +10288,14 @@ to replace some constants with variables having the same values for pertinent portions of code, it is important that compilers treat code so modified in the same way so that the results of such programs are the same. -@code{g77} helps in this regard by treating constants just +@command{g77} helps in this regard by treating constants just the same as variables in terms of determining their types in a context-independent way. Still, there is a lot of existing Fortran code that has been written to depend on the way other compilers freely interpret constants' types based on context, so anything -@code{g77} can do to help flag cases of this in such code +@command{g77} can do to help flag cases of this in such code could be very helpful. @node Equivalence Versus Equality @@ -10276,7 +10305,7 @@ could be very helpful. @cindex logical expressions, comparing Use of @code{.EQ.} and @code{.NE.} on @code{LOGICAL} operands -is not supported, except via @samp{-fugly-logint}, which is not +is not supported, except via @option{-fugly-logint}, which is not recommended except for legacy code (where the behavior expected by the @emph{code} is assumed). @@ -10326,7 +10355,7 @@ own distinct precedence) to compare @code{LOGICAL} operands. This requirement results in expression syntax with more certain precedence (without requiring substantial context), making it easier for programmers to read existing code. -@code{g77} will avoid muddying up elements of the Fortran language +@command{g77} will avoid muddying up elements of the Fortran language that were well-designed in the first place. (Ask C programmers about the precedence of expressions such as @@ -10353,11 +10382,11 @@ that might diagnose it. @cindex side effects, order of evaluation @cindex order of evaluation, side effects -@code{g77} does not necessarily produce code that, when run, performs +@command{g77} does not necessarily produce code that, when run, performs side effects (such as those performed by function invocations) in the same order as in some other compiler---or even in the same order as another version, port, or invocation (using different -command-line options) of @code{g77}. +command-line options) of @command{g77}. It is never safe to depend on the order of evaluation of side effects. For example, an expression like this may very well behave differently @@ -10433,17 +10462,17 @@ Warnings might indicate danger points where you should check to make sure that your program really does what you intend; or the use of obsolete features; or the use of nonstandard features of GNU Fortran. Many warnings are issued only if you ask for them, with one of the -@samp{-W} options (for instance, @samp{-Wall} requests a variety of +@option{-W} options (for instance, @option{-Wall} requests a variety of useful warnings). @emph{Note:} Currently, the text of the line and a pointer to the column -is printed in most @code{g77} diagnostics. -Probably, as of version 0.6, @code{g77} will +is printed in most @command{g77} diagnostics. +Probably, as of version 0.6, @command{g77} will no longer print the text of the source line, instead printing the column number following the file name and line number in a form that GNU Emacs recognizes. This change is expected to speed up and reduce the memory usage -of the @code{g77} compiler. +of the @command{g77} compiler. @c @c Say this when it is true -- hopefully 0.6, maybe 0.7 or later. --burley @c @@ -10452,8 +10481,8 @@ of the @code{g77} compiler. @c (for instance) it fails to conform to a standard. In some cases, @c however, the Fortran standard specifies that certain extensions are @c forbidden, and a diagnostic @emph{must} be issued by a conforming -@c compiler. The @samp{-pedantic} option tells GNU Fortran to issue warnings -@c in such cases; @samp{-pedantic-errors} says to make them errors instead. +@c compiler. The @option{-pedantic} option tells GNU Fortran to issue warnings +@c in such cases; @option{-pedantic-errors} says to make them errors instead. @c This does not mean that @emph{all} non-ANSI constructs get warnings @c or errors. @@ -10582,33 +10611,33 @@ If you are an experienced user of Fortran compilers, your suggestions for improvement of GNU Fortran are welcome in any case. @end itemize -Many, perhaps most, bug reports against @code{g77} turn out to +Many, perhaps most, bug reports against @command{g77} turn out to be bugs in the user's code. While we find such bug reports educational, they sometimes take a considerable amount of time to track down or at least respond -to---time we could be spending making @code{g77}, not some user's +to---time we could be spending making @command{g77}, not some user's code, better. Some steps you can take to verify that the bug is not certainly -in the code you're compiling with @code{g77}: +in the code you're compiling with @command{g77}: @itemize @bullet @item -Compile your code using the @code{g77} options @samp{-W -Wall -O}. -These options enable many useful warning; the @samp{-O} option +Compile your code using the @command{g77} options @samp{-W -Wall -O}. +These options enable many useful warning; the @option{-O} option enables flow analysis that enables the uninitialized-variable warning. If you investigate the warnings and find evidence of possible bugs -in your code, fix them first and retry @code{g77}. +in your code, fix them first and retry @command{g77}. @item -Compile your code using the @code{g77} options @samp{-finit-local-zero}, -@samp{-fno-automatic}, @samp{-ffloat-store}, and various +Compile your code using the @command{g77} options @option{-finit-local-zero}, +@option{-fno-automatic}, @option{-ffloat-store}, and various combinations thereof. If your code works with any of these combinations, that is not -proof that the bug isn't in @code{g77}---a @code{g77} bug exposed +proof that the bug isn't in @command{g77}---a @command{g77} bug exposed by your code might simply be avoided, or have a different, more subtle effect, when different options are used---but it can be a strong indicator that your code is making unwarranted assumptions @@ -10616,8 +10645,8 @@ about the Fortran dialect and/or underlying machine it is being compiled and run on. @xref{Overly Convenient Options,,Overly Convenient Command-Line Options}, -for information on the @samp{-fno-automatic} and -@samp{-finit-local-zero} options and how to convert +for information on the @option{-fno-automatic} and +@option{-finit-local-zero} options and how to convert their use into selective changes in your own code. @item @@ -10685,14 +10714,14 @@ depend: ; \ @end smallexample @item -Try your code out using other Fortran compilers, such as @code{f2c}. +Try your code out using other Fortran compilers, such as @command{f2c}. If it does not work on at least one other compiler (assuming the compiler supports the features the code needs), that is a strong indicator of a bug in the code. However, even if your code works on many compilers @emph{except} -@code{g77}, that does @emph{not} mean the bug is in @code{g77}. -It might mean the bug is in your code, and that @code{g77} simply +@command{g77}, that does @emph{not} mean the bug is in @command{g77}. +It might mean the bug is in your code, and that @command{g77} simply exposes it more readily than other compilers. @end itemize @@ -10795,7 +10824,7 @@ things: @itemize @bullet @item The version of GNU Fortran. -You can get this by running @code{g77} with the @samp{-v} option. +You can get this by running @command{g77} with the @option{-v} option. (Ignore any error messages that might be displayed when the linker is run.) @@ -10818,7 +10847,7 @@ run your source file through the C preprocessor by doing @samp{g77 -E @var{sourcefile} > @var{newfile}}. Then, include the contents of @var{newfile} in the bug report. (When you do this, use the same preprocessor options---such as -@samp{-I}, @samp{-D}, and @samp{-U}---that you used in actual +@option{-I}, @option{-D}, and @option{-U}---that you used in actual compilation.) A single statement is not enough of an example. @@ -10855,7 +10884,7 @@ chases. @item The command arguments you gave GNU Fortran to compile that example -and observe the bug. For example, did you use @samp{-O}? To guarantee +and observe the bug. For example, did you use @option{-O}? To guarantee you won't omit something important, list all the options. If we were to try to guess the arguments, we would probably guess wrong @@ -10923,7 +10952,7 @@ bug in the program itself. @item If you send examples of assembler code output from GNU Fortran, -please use @samp{-g} when you make them. The debugging information +please use @option{-g} when you make them. The debugging information includes source line numbers which are essential for correlating the output with the input. @@ -11062,9 +11091,9 @@ Send a message to @email{@value{email-help}}. @cindex options, adding @cindex adding options -To add a new command-line option to @code{g77}, first decide +To add a new command-line option to @command{g77}, first decide what kind of option you wish to add. -Search the @code{g77} and @code{gcc} documentation for one +Search the @command{g77} and @command{gcc} documentation for one or more options that is most closely like the one you want to add (in terms of what kind of effect it has, and so on) to help clarify its nature. @@ -11073,7 +11102,7 @@ help clarify its nature. @item @emph{Fortran options} are options that apply only when compiling Fortran programs. -They are accepted by @code{g77} and @code{gcc}, but +They are accepted by @command{g77} and @command{gcc}, but they apply only when compiling Fortran programs. @item @@ -11083,7 +11112,7 @@ when compiling most any kind of program. @emph{Fortran options} are listed in the file @file{@value{path-g77}/lang-options.h}, -which is used during the build of @code{gcc} to +which is used during the build of @command{gcc} to build a list of all options that are accepted by at least one language's compiler. This list goes into the @code{documented_lang_options} array @@ -11091,7 +11120,7 @@ in @file{gcc/toplev.c}, which uses this array to determine whether a particular option should be offered to the linked-in front end for processing by calling @code{lang_option_decode}, which, for -@code{g77}, is in @file{@value{path-g77}/com.c} and just +@command{g77}, is in @file{@value{path-g77}/com.c} and just calls @code{ffe_decode_option}. If the linked-in front end ``rejects'' a @@ -11101,16 +11130,16 @@ language's compiler is willing to accept it. This allows commands like @samp{gcc -fno-asm foo.c bar.f} to work, even though Fortran compilation does -not currently support the @samp{-fno-asm} option; +not currently support the @option{-fno-asm} option; even though the @code{f771} version of @code{lang_decode_option} -rejects @samp{-fno-asm}, @file{toplev.c} doesn't +rejects @option{-fno-asm}, @file{toplev.c} doesn't produce a diagnostic because some other language (C) does accept it. This also means that commands like @samp{g77 -fno-asm foo.f} yield no diagnostics, despite the fact that no phase of the command was -able to recognize and process @samp{-fno-asm}---perhaps +able to recognize and process @option{-fno-asm}---perhaps a warning about this would be helpful if it were possible. @@ -11129,10 +11158,10 @@ should behave the same way on all configurations (especially when it comes to language constructs), the practice of setting defaults in @file{target.h} is likely to be deprecated and, ultimately, stopped -in future versions of @code{g77}. +in future versions of @command{g77}. Accessor macros for Fortran options, used by code -in the @code{g77} FFE, are defined in @file{@value{path-g77}/top.h}. +in the @command{g77} FFE, are defined in @file{@value{path-g77}/top.h}. @emph{Compiler options} are listed in @file{gcc/toplev.c} in the array @code{f_options}. @@ -11145,42 +11174,42 @@ some of which are in @file{gcc/toplev.c}. You can set different defaults for @emph{Fortran-oriented} or @emph{Fortran-reticent} compiler options by changing -the source code of @code{g77} and rebuilding. -How to do this depends on the version of @code{g77}: +the source code of @command{g77} and rebuilding. +How to do this depends on the version of @command{g77}: @table @code @item G77 0.5.24 (EGCS 1.1) @itemx G77 0.5.25 (EGCS 1.2 - which became GCC 2.95) Change the @code{lang_init_options} routine in @file{gcc/gcc/f/com.c}. -(Note that these versions of @code{g77} +(Note that these versions of @command{g77} perform internal consistency checking automatically -when the @samp{-fversion} option is specified.) +when the @option{-fversion} option is specified.) @item G77 0.5.23 @itemx G77 0.5.24 (EGCS 1.0) -Change the way @code{f771} handles the @samp{-fset-g77-defaults} +Change the way @code{f771} handles the @option{-fset-g77-defaults} option, which is always provided as the first option when -called by @code{g77} or @code{gcc}. +called by @command{g77} or @command{gcc}. This code is in @code{ffe_decode_options} in @file{@value{path-g77}/top.c}. Have it change just the variables that you want to default to a different setting for Fortran compiles compared to compiles of other languages. -The @samp{-fset-g77-defaults} option is passed to @code{f771} +The @option{-fset-g77-defaults} option is passed to @code{f771} automatically because of the specification information kept in @file{@value{path-g77}/lang-specs.h}. -This file tells the @code{gcc} command how to recognize, +This file tells the @command{gcc} command how to recognize, in this case, Fortran source files (those to be preprocessed, and those that are not), and further, how to invoke the appropriate programs (including @code{f771}) to process those source files. -It is in @file{@value{path-g77}/lang-specs.h} that @samp{-fset-g77-defaults}, -@samp{-fversion}, and other options are passed, as appropriate, +It is in @file{@value{path-g77}/lang-specs.h} that @option{-fset-g77-defaults}, +@option{-fversion}, and other options are passed, as appropriate, even when the user has not explicitly specified them. -Other ``internal'' options such as @samp{-quiet} also +Other ``internal'' options such as @option{-quiet} also are passed via this mechanism. @end table @@ -11188,22 +11217,22 @@ are passed via this mechanism. @chapter Projects @cindex projects -If you want to contribute to @code{g77} by doing research, +If you want to contribute to @command{g77} by doing research, design, specification, documentation, coding, or testing, the following information should give you some ideas. More relevant information might be available from @uref{ftp://alpha.gnu.org/gnu/g77/projects/}. @menu -* Efficiency:: Make @code{g77} itself compile code faster. -* Better Optimization:: Teach @code{g77} to generate faster code. -* Simplify Porting:: Make @code{g77} easier to configure, build, +* Efficiency:: Make @command{g77} itself compile code faster. +* Better Optimization:: Teach @command{g77} to generate faster code. +* Simplify Porting:: Make @command{g77} easier to configure, build, and install. * More Extensions:: Features many users won't know to ask for. -* Machine Model:: @code{g77} should better leverage @code{gcc}. +* Machine Model:: @command{g77} should better leverage @command{gcc}. * Internals Documentation:: Make maintenance easier. * Internals Improvements:: Make internals more robust. -* Better Diagnostics:: Make using @code{g77} on new code easier. +* Better Diagnostics:: Make using @command{g77} on new code easier. @end menu @node Efficiency @@ -11243,7 +11272,7 @@ is not a subroutine intrinsic, would result actual error instead of the unimplemented-statement catch-all. @item -Throughout @code{g77}, don't pass line/column pairs where +Throughout @command{g77}, don't pass line/column pairs where a simple @code{ffewhere} type, which points to the error as much as is desired by the configuration, will do, and don't pass @code{ffelexToken} types where a simple @code{ffewhere} type will do. @@ -11262,7 +11291,7 @@ improve maintainability.) Handle @samp{DATA (A(I),I=1,1000000)/1000000*2/} more efficiently, especially as regards the assembly output. Some of this might require improving -the back end, but lots of improvement in space/time required in @code{g77} +the back end, but lots of improvement in space/time required in @command{g77} itself can be fairly easily obtained without touching the back end. Maybe type-conversion, where necessary, can be speeded up as well in cases like the one shown (converting the @samp{2} into @samp{2.}). @@ -11281,7 +11310,7 @@ own. @cindex optimization, better @cindex code generation, improving -Much of this work should be put off until after @code{g77} has +Much of this work should be put off until after @command{g77} has all the features necessary for its widespread acceptance as a useful F77 compiler. However, perhaps this work can be done in parallel during @@ -11291,7 +11320,7 @@ the feature-adding work. @item Do the equivalent of the trick of putting @samp{extern inline} in front of every function definition in @code{libg2c} and #include'ing the resulting -file in @code{f2c}+@code{gcc}---that is, inline all run-time-library functions +file in @command{f2c}+@command{gcc}---that is, inline all run-time-library functions that are at all worth inlining. (Some of this has already been done, such as for integral exponentiation.) @@ -11326,7 +11355,7 @@ Among the important things the library would do are: Be a one-stop-shop-type library, hence shareable and usable by all, in that what are now library-build-time options in @code{libg2c} would be moved at least to the -@code{g77} compile phase, if not to finer grains (such as choosing how +@command{g77} compile phase, if not to finer grains (such as choosing how list-directed I/O formatting is done by default at @code{OPEN} time, for preconnected units via options or even statements in the main program unit, maybe even on a per-I/O basis with appropriate pragma-like @@ -11336,14 +11365,14 @@ devices). @item Probably requiring the new library design, change interface to normally have @code{COMPLEX} functions return their values in the way -@code{gcc} would if they were declared @code{__complex__ float}, +@command{gcc} would if they were declared @code{__complex__ float}, rather than using the mechanism currently used by @code{CHARACTER} functions (whereby the functions are compiled as returning void and their first arg is a pointer to where to store the result). (Don't append underscores to -external names for @code{COMPLEX} functions in some cases once @code{g77} uses -@code{gcc} rather than @code{f2c} calling conventions.) +external names for @code{COMPLEX} functions in some cases once @command{g77} uses +@command{gcc} rather than @command{f2c} calling conventions.) @item Do something useful with @code{doiter} references where possible. @@ -11362,7 +11391,7 @@ for Fortran-77 code.) @cindex porting, simplify @cindex simplify porting -Making @code{g77} easier to configure, port, build, and install, either +Making @command{g77} easier to configure, port, build, and install, either as a single-system compiler or as a cross-compiler, would be very useful. @@ -11370,7 +11399,7 @@ very useful. @item A new library (replacing @code{libg2c}) should improve portability as well as produce more optimal code. -Further, @code{g77} and the new library should +Further, @command{g77} and the new library should conspire to simplify naming of externals, such as by removing unnecessarily added underscores, and to reduce/eliminate the possibility of naming conflicts, while making debugger more straightforward. @@ -11381,8 +11410,8 @@ Fortran intrinsics that get Fortran unit numbers given C @code{FILE *} descriptors. @item -Possibly related to a new library, @code{g77} should produce the equivalent -of a @code{gcc} @samp{main(argc, argv)} function when it compiles a +Possibly related to a new library, @command{g77} should produce the equivalent +of a @command{gcc} @samp{main(argc, argv)} function when it compiles a main program unit, instead of compiling something that must be called by a library implementation of @code{main()}. @@ -11395,7 +11424,7 @@ not requiring programmers to start their debugging sessions with @item The GBE needs to understand the difference between alignment requirements and desires. -For example, on Intel x86 machines, @code{g77} currently imposes +For example, on Intel x86 machines, @command{g77} currently imposes overly strict alignment requirements, due to the back end, but it would be useful for Fortran and C programmers to be able to override these @emph{recommendations} as long as they don't violate the actual @@ -11407,9 +11436,9 @@ processor @emph{requirements}. @cindex extensions, more These extensions are not the sort of things users ask for ``by name'', -but they might improve the usability of @code{g77}, and Fortran in +but they might improve the usability of @command{g77}, and Fortran in general, in the long run. -Some of these items really pertain to improving @code{g77} internals +Some of these items really pertain to improving @command{g77} internals so that some popular extensions can be more easily supported. @itemize @bullet @@ -11448,7 +11477,7 @@ later @code{UNIT=} in the first example is invalid. Make sure this is what users of this feature would expect. @item -Currently @code{g77} disallows @samp{READ(1'10)} since +Currently @command{g77} disallows @samp{READ(1'10)} since it is an obnoxious syntax, but supporting it might be pretty easy if needed. More details are needed, such @@ -11466,7 +11495,7 @@ This requires either major changes to @code{libg2c} or its replacement. @item -F90 and @code{g77} probably disagree about label scoping relative to +F90 and @command{g77} probably disagree about label scoping relative to @code{INTERFACE} and @code{END INTERFACE}, and their contained procedure interface bodies (blocks?). @@ -11490,7 +11519,7 @@ other (besides @code{CLOSE}) to assist in making applications port to systems @node Machine Model @section Machine Model -This items pertain to generalizing @code{g77}'s view of +This items pertain to generalizing @command{g77}'s view of the machine model to more fully accept whatever the GBE provides it via its configuration. @@ -11499,7 +11528,7 @@ provides it via its configuration. Switch to using @code{REAL_VALUE_TYPE} to represent floating-point constants exclusively so the target float format need not be required. This -means changing the way @code{g77} handles initialization of aggregate areas +means changing the way @command{g77} handles initialization of aggregate areas having more than one type, such as @code{REAL} and @code{INTEGER}, because currently it initializes them as if they were arrays of @code{char} and uses the @@ -11508,12 +11537,12 @@ what to stuff in elements of the arrays. @item Rely more and more on back-end info and capabilities, especially in the -area of constants (where having the @code{g77} front-end's IL just store +area of constants (where having the @command{g77} front-end's IL just store the appropriate tree nodes containing constants might be best). @item Suite of C and Fortran programs that a user/administrator can run on a -machine to help determine the configuration for @code{g77} before building +machine to help determine the configuration for @command{g77} before building and help determine if the compiler works (especially with whatever libraries are installed) after building. @end itemize @@ -11521,17 +11550,17 @@ libraries are installed) after building. @node Internals Documentation @section Internals Documentation -Better info on how @code{g77} works and how to port it is needed. +Better info on how @command{g77} works and how to port it is needed. Much of this should be done only after the redesign planned for 0.6 is complete. @xref{Front End}, which contains some information -on @code{g77} internals. +on @command{g77} internals. @node Internals Improvements @section Internals Improvements -Some more items that would make @code{g77} more reliable +Some more items that would make @command{g77} more reliable and easier to maintain: @itemize @bullet @@ -11548,7 +11577,7 @@ important to preserve the left-to-right-in-source order of production of diagnostics.) @item -Come up with better naming conventions for @samp{-D} to establish requirements +Come up with better naming conventions for @option{-D} to establish requirements to achieve desired implementation dialect via @file{proj.h}. @item @@ -11585,7 +11614,7 @@ not worth the time). @item Implement C macros @samp{RETURNS(value)} and @samp{SETS(something,value)} in @file{proj.h} -and use them throughout @code{g77} source code (especially in the definitions +and use them throughout @command{g77} source code (especially in the definitions of access macros in @samp{.h} files) so they can be tailored to catch code writing into a @samp{RETURNS()} or reading from a @samp{SETS()}. @@ -11664,7 +11693,7 @@ statements.) @chapter Diagnostics @cindex diagnostics -Some diagnostics produced by @code{g77} require sufficient explanation +Some diagnostics produced by @command{g77} require sufficient explanation that the explanations are given below, and the diagnostics themselves identify the appropriate explanation. @@ -11677,7 +11706,7 @@ For example: foo.f:5: Invalid statement [info -f g77 M FOOEY] @end smallexample -More details about the above diagnostic is found in the @code{g77} Info +More details about the above diagnostic is found in the @command{g77} Info documentation, menu item @samp{M}, submenu item @samp{FOOEY}, which is displayed by typing the UNIX command @samp{info -f g77 M FOOEY}. @@ -11691,7 +11720,7 @@ this chapter, which is the very text you're reading now), @samp{FOOEY} is the menu item to select. @iftex -In this printed version of the @code{g77} manual, the above example +In this printed version of the @command{g77} manual, the above example points to a section, below, entitled @samp{FOOEY}---though, of course, as the above is just a sample, no such section exists. @end iftex @@ -11844,11 +11873,11 @@ the same expectation regarding interpretation, you can: @itemize @bullet @item -Compile with the @code{g77} option @samp{-ff90}, to enable the +Compile with the @command{g77} option @option{-ff90}, to enable the Fortran 90 interpretation. @item -Compile with the @code{g77} options @samp{-fno-f90 -fugly-complex}, +Compile with the @command{g77} options @samp{-fno-f90 -fugly-complex}, to enable the non-Fortran-90 interpretations. @end itemize @@ -11922,7 +11951,7 @@ in another program unit in the same source file. This diagnostic is designed to catch cases where a program might depend on using the name @var{intrinsic} as an intrinsic in one program unit and as a global name (such as the name -of a subroutine or function) in another, but @code{g77} recognizes +of a subroutine or function) in another, but @command{g77} recognizes the name as an intrinsic in both cases. After verifying that the program unit making implicit use @@ -11931,15 +11960,15 @@ add an @samp{INTRINSIC @var{intrinsic}} statement to that program unit to prevent this warning. This and related warnings are disabled by using -the @samp{-Wno-globals} option when compiling. +the @option{-Wno-globals} option when compiling. Note that this warning is not issued for standard intrinsics. Standard intrinsics include those described in the FORTRAN 77 -standard and, if @samp{-ff90} is specified, those described +standard and, if @option{-ff90} is specified, those described in the Fortran 90 standard. Such intrinsics are not as likely to be confused with user procedures as intrinsics provided as extensions to the -standard by @code{g77}. +standard by @command{g77}. @node INTGLOB @section @code{INTGLOB} @@ -11954,7 +11983,7 @@ block or a program unit) in one program unit and implicitly used as an intrinsic in another program unit. This diagnostic is designed to catch cases where a program -intends to use a name entirely as a global name, but @code{g77} +intends to use a name entirely as a global name, but @command{g77} recognizes the name as an intrinsic in the program unit that references the name, a situation that would likely produce incorrect code. @@ -11974,14 +12003,14 @@ END The above example defines a program unit named @samp{TIME}, but the reference to @samp{TIME} in the main program unit @samp{SAMP} -is normally treated by @code{g77} as a reference to the intrinsic +is normally treated by @command{g77} as a reference to the intrinsic @code{TIME()} (unless a command-line option that prevents such treatment has been specified). As a result, the program @samp{SAMP} will @emph{not} invoke the @samp{TIME} function in the same source file. -Since @code{g77} recognizes @code{libU77} procedures as +Since @command{g77} recognizes @code{libU77} procedures as intrinsics, and since some existing code uses the same names for its own procedures as used by some @code{libU77} procedures, this situation is expected to arise often enough @@ -11994,20 +12023,20 @@ program unit to prevent this warning. Or, if you believe the program unit is designed to invoke the program-defined procedure instead of the intrinsic (as -recognized by @code{g77}), add an @samp{EXTERNAL @var{intrinsic}} +recognized by @command{g77}), add an @samp{EXTERNAL @var{intrinsic}} statement to the program unit that references the name to prevent this warning. This and related warnings are disabled by using -the @samp{-Wno-globals} option when compiling. +the @option{-Wno-globals} option when compiling. Note that this warning is not issued for standard intrinsics. Standard intrinsics include those described in the FORTRAN 77 -standard and, if @samp{-ff90} is specified, those described +standard and, if @option{-ff90} is specified, those described in the Fortran 90 standard. Such intrinsics are not as likely to be confused with user procedures as intrinsics provided as extensions to the -standard by @code{g77}. +standard by @command{g77}. @node LEX @section @code{LEX} @@ -12044,7 +12073,7 @@ of parentheses, it might be Lisp source code; if it contains lots of bugs, it might be C++ source code. @item -The source file contains free-form Fortran code, but @samp{-ffree-form} +The source file contains free-form Fortran code, but @option{-ffree-form} was not specified on the command line to compile it. Free form is a newer form for Fortran code. @@ -12136,23 +12165,23 @@ requires preprocessing. If the file's suffix is @samp{.f}, @samp{.for}, or @samp{.FOR}, the file normally will be compiled @emph{without} preprocessing -by @code{g77}. +by @command{g77}. Change the file's suffix from @samp{.f} to @samp{.F} (or, on systems with case-insensitive file names, to @samp{.fpp} or @samp{.FPP}), from @samp{.for} to @samp{.fpp}, or from @samp{.FOR} to @samp{.FPP}. -@code{g77} compiles files with such names @emph{with} +@command{g77} compiles files with such names @emph{with} preprocessing. @pindex cpp @cindex preprocessor @cindex cpp program @cindex programs, cpp -@cindex @samp{-x f77-cpp-input} option -@cindex options, @samp{-x f77-cpp-input} -Or, learn how to use @code{gcc}'s @samp{-x} option to specify +@cindex @option{-x f77-cpp-input} option +@cindex options, @option{-x f77-cpp-input} +Or, learn how to use @command{gcc}'s @option{-x} option to specify the language @samp{f77-cpp-input} for Fortran files that require preprocessing. @xref{Overall Options,,gcc,Using and Porting GNU CC}. @@ -12204,16 +12233,16 @@ Other disagreements are diagnosed via warnings. @cindex in-line code @cindex compilation, in-line This distinction, between warnings and errors, -is due primarily to the present tendency of the @code{gcc} back end +is due primarily to the present tendency of the @command{gcc} back end to inline only those procedure invocations that are @emph{preceded} by the corresponding procedure definitions. -If the @code{gcc} back end is changed +If the @command{gcc} back end is changed to inline ``forward references'', in which invocations precede definitions, -the @code{g77} front end will be changed +the @command{g77} front end will be changed to treat both orderings as errors, accordingly. -The sorts of disagreements that are diagnosed by @code{g77} include +The sorts of disagreements that are diagnosed by @command{g77} include whether a procedure is a subroutine or function; if it is a function, the type of the return value of the procedure; the number of arguments the procedure accepts; @@ -12224,18 +12253,18 @@ in a Fortran program @emph{should} be fixed in the code itself. However, if that is not immediately practical, and the code has been working for some time, it is possible it will work -when compiled with the @samp{-fno-globals} option. +when compiled with the @option{-fno-globals} option. -The @samp{-fno-globals} option +The @option{-fno-globals} option causes these diagnostics to all be warnings and disables all inlining of references to global procedures (to avoid subsequent compiler crashes and bad-code generation). -Use of the @samp{-Wno-globals} option as well as @samp{-fno-globals} +Use of the @option{-Wno-globals} option as well as @option{-fno-globals} suppresses all of these diagnostics. -(@samp{-Wno-globals} by itself disables only the warnings, +(@option{-Wno-globals} by itself disables only the warnings, not the errors.) -After using @samp{-fno-globals} to work around these problems, +After using @option{-fno-globals} to work around these problems, it is wise to stop using that option and address them by fixing the Fortran code, because such problems, while they might not actually result in bugs on some systems, indicate that the code @@ -12248,14 +12277,14 @@ without exhibiting any other outward manifestations of the bugs. @section @code{LINKFAIL} @noindent -On AIX 4.1, @code{g77} might not build with the native (non-GNU) tools -due to a linker bug in coping with the @samp{-bbigtoc} option which +On AIX 4.1, @command{g77} might not build with the native (non-GNU) tools +due to a linker bug in coping with the @option{-bbigtoc} option which leads to a @samp{Relocation overflow} error. The GNU linker is not recommended on current AIX versions, though; it was developed under a now-unsupported version. This bug is said to be fixed by `update PTF U455193 for APAR IX75823'. -Compiling with @samp{-mminimal-toc} +Compiling with @option{-mminimal-toc} might solve this problem, e.g.@: by adding @smallexample BOOT_CFLAGS='-mminimal-toc -O2 -g' diff --git a/gcc/f/invoke.texi b/gcc/f/invoke.texi index 38b17d52..f8a355e 100644 --- a/gcc/f/invoke.texi +++ b/gcc/f/invoke.texi @@ -30,7 +30,7 @@ included in the gfdl(7) man page. @setfilename g77 @settitle GNU project Fortran 77 compiler. @c man begin SYNOPSIS -g77 [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}] +g77 [@option{-c}|@option{-S}|@option{-E}] [@option{-g}] [@option{-pg}] [@option{-O}@var{level}] [@option{-W}@var{warn}@dots{}] [@option{-pedantic}] [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}] @@ -54,7 +54,7 @@ script to report bugs is recommended. @c man end @c man begin AUTHOR See the Info entry for @file{g77}, or -@w{@uref{http://gcc.gnu.org/thanks.html}}, for contributors to G77@. +@w{@uref{http://gcc.gnu.org/thanks.html}}, for contributors to GCC and G77@. @c man end @end ignore @@ -66,32 +66,32 @@ See the Info entry for @file{g77}, or @c man begin DESCRIPTION -The @code{g77} command supports all the options supported by the -@code{gcc} command. +The @command{g77} command supports all the options supported by the +@command{gcc} command. @xref{Invoking GCC,,GNU CC Command Options,gcc,Using and Porting GNU CC}, for information -on the non-Fortran-specific aspects of the @code{gcc} command (and, -therefore, the @code{g77} command). +on the non-Fortran-specific aspects of the @command{gcc} command (and, +therefore, the @command{g77} command). @cindex options, negative forms @cindex negative forms of options -All @code{gcc} and @code{g77} options -are accepted both by @code{g77} and by @code{gcc} +All @command{gcc} and @command{g77} options +are accepted both by @command{g77} and by @command{gcc} (as well as any other drivers built at the same time, such as @code{g++}), -since adding @code{g77} to the @code{gcc} distribution -enables acceptance of @code{g77}-specific options +since adding @command{g77} to the @command{gcc} distribution +enables acceptance of @command{g77} options by all of the relevant drivers. In some cases, options have positive and negative forms; -the negative form of @samp{-ffoo} would be @samp{-fno-foo}. +the negative form of @option{-ffoo} would be @option{-fno-foo}. This manual documents only one of these two forms, whichever one is not the default. @c man end @menu -* Option Summary:: Brief list of all @code{g77} options, +* Option Summary:: Brief list of all @command{g77} options, without explanations. * Overall Options:: Controlling the kind of output: an executable, object files, assembler files, @@ -122,19 +122,17 @@ by type. Explanations are in the following sections. @table @emph @item Overall Options @xref{Overall Options,,Options Controlling the Kind of Output}. -@smallexample --fversion -fset-g77-defaults -fno-silent -@end smallexample +@gccoptlist{ +-fversion -fset-g77-defaults -fno-silent} @item Shorthand Options @xref{Shorthand Options}. -@smallexample --ff66 -fno-f66 -ff77 -fno-f77 -fno-ugly -@end smallexample +@gccoptlist{ +-ff66 -fno-f66 -ff77 -fno-f77 -fno-ugly} @item Fortran Language Options @xref{Fortran Dialect Options,,Options Controlling Fortran Dialect}. -@smallexample +@gccoptlist{ -ffree-form -fno-fixed-form -ff90 -fvxt -fdollar-ok -fno-backslash -fno-ugly-args -fno-ugly-assign -fno-ugly-assumed @@ -164,27 +162,24 @@ by type. Explanations are in the following sections. -funix-intrinsics-disable -funix-intrinsics-enable -fvxt-intrinsics-delete -fvxt-intrinsics-hide -fvxt-intrinsics-disable -fvxt-intrinsics-enable --ffixed-line-length-@var{n} -ffixed-line-length-none -@end smallexample +-ffixed-line-length-@var{n} -ffixed-line-length-none} @item Warning Options @xref{Warning Options,,Options to Request or Suppress Warnings}. -@smallexample +@gccoptlist{ -fsyntax-only -pedantic -pedantic-errors -fpedantic -w -Wno-globals -Wimplicit -Wunused -Wuninitialized -Wall -Wsurprising --Werror -W -@end smallexample +-Werror -W} @item Debugging Options @xref{Debugging Options,,Options for Debugging Your Program or GCC}. -@smallexample --g -@end smallexample +@gccoptlist{ +-g} @item Optimization Options @xref{Optimize Options,,Options that Control Optimization}. -@smallexample +@gccoptlist{ -malign-double -ffloat-store -fforce-mem -fforce-addr -fno-inline -ffast-math -fstrength-reduce -frerun-cse-after-loop @@ -193,18 +188,16 @@ by type. Explanations are in the following sections. -fschedule-insns -fschedule-insn2 -fcaller-saves -funroll-loops -funroll-all-loops -fno-move-all-movables -fno-reduce-all-givs --fno-rerun-loop-opt -@end smallexample +-fno-rerun-loop-opt} @item Directory Options @xref{Directory Options,,Options for Directory Search}. -@smallexample --I@var{dir} -I- -@end smallexample +@gccoptlist{ +-I@var{dir} -I-} @item Code Generation Options @xref{Code Gen Options,,Options for Code Generation Conventions}. -@smallexample +@gccoptlist{ -fno-automatic -finit-local-zero -fno-f2c -ff2c-library -fno-underscoring -fno-ident -fpcc-struct-return -freg-struct-return @@ -214,8 +207,7 @@ by type. Explanations are in the following sections. -falias-check -fargument-alias -fargument-noalias -fno-argument-noalias-global -fno-globals -fflatten-arrays --fbounds-check -ffortran-bounds-check -@end smallexample +-fbounds-check -ffortran-bounds-check} @end table @c man end @@ -265,7 +257,7 @@ Suffixes specific to GNU Fortran are listed below. @xref{Overall Options,,gcc,Using and Porting GNU CC}, for information on suffixes recognized by GNU CC. -@table @code +@table @gcctabopt @cindex .f filename suffix @cindex .for filename suffix @cindex .FOR filename suffix @@ -278,7 +270,7 @@ Such source code cannot contain any preprocessor directives, such as @code{#include}, @code{#define}, @code{#if}, and so on. You can force @samp{.f} files to be preprocessed by @code{cpp} by using -@samp{-x f77-cpp-input}. +@option{-x f77-cpp-input}. @xref{LEX}. @cindex preprocessor @@ -308,7 +300,7 @@ preprocessor directive must be used instead. Ratfor source code, which must be preprocessed by the @code{ratfor} command, which is available separately (as it is not yet part of the GNU Fortran distribution). -One version in Fortran, adapted for use with @code{g77}, is at +One version in Fortran, adapted for use with @command{g77} is at @uref{ftp://members.aol.com/n8tm/rat7.uue} (of uncertain copyright status). Another, public domain version in C is at @uref{http://sepwww.stanford.edu/sep/prof/ratfor.shar.2}. @@ -355,7 +347,7 @@ along with the subsequent newline, resulting in the next line being effectively commented out---unfortunate if that line is a non-comment line of important code! -@emph{Note:} The @samp{-traditional} and @samp{-undef} flags are supplied +@emph{Note:} The @option{-traditional} and @option{-undef} flags are supplied to @code{cpp} by default, to help avoid unpleasant surprises. @xref{Preprocessor Options,,Options Controlling the Preprocessor, gcc,Using and Porting GNU CC}. @@ -365,10 +357,10 @@ namespace (generally, names with a leading underscore) are liable to substitution by C predefines. Thus, if you want to do system-specific tests, use, for example, @samp{#ifdef __linux__} rather than @samp{#ifdef linux}. -Use the @samp{-v} option to see exactly how the preprocessor is invoked. +Use the @option{-v} option to see exactly how the preprocessor is invoked. @cindex /* -Unfortunately, the @samp{-traditional} flag will not avoid an error from +Unfortunately, the @option{-traditional} flag will not avoid an error from anything that @code{cpp} sees as an unterminated C comment, such as: @smallexample C Some Fortran compilers accept /* as starting @@ -377,9 +369,9 @@ C an inline comment. @xref{Trailing Comment}. The following options that affect overall processing are recognized -by the @code{g77} and @code{gcc} commands in a GNU Fortran installation: +by the @command{g77} and @command{gcc} commands in a GNU Fortran installation: -@table @code +@table @gcctabopt @cindex -fversion option @cindex options, -fversion @cindex printing version information @@ -388,15 +380,18 @@ by the @code{g77} and @code{gcc} commands in a GNU Fortran installation: @cindex internal consistency checks @cindex checks, of internal consistency @item -fversion -Ensure that the @code{g77}-specific version of the compiler phase is reported, +Ensure that the @command{g77} version of the compiler phase is reported, if run, and, starting in @code{egcs} version 1.1, that internal consistency checks in the @file{f771} program are run. -This option is supplied automatically when @samp{-v} or @samp{--verbose} -is specified as a command-line option for @code{g77} or @code{gcc} +This option is supplied automatically when @option{-v} or @option{--verbose} +is specified as a command-line option for @command{g77} or @command{gcc} and when the resulting commands compile Fortran source files. +In GCC 3.1, this is changed back to the behaviour @command{gcc} displays +for @samp{.c} files. + @cindex -fset-g77-defaults option @cindex options, -fset-g77-defaults @item -fset-g77-defaults @@ -410,12 +405,12 @@ in @file{gcc/gcc/f/com.c}. @cindex consistency checks @cindex internal consistency checks @cindex checks, of internal consistency -Set up whatever @code{gcc} options are to apply to Fortran +Set up whatever @command{gcc} options are to apply to Fortran compilations, and avoid running internal consistency checks that might take some time. This option is supplied automatically when compiling Fortran code -via the @code{g77} or @code{gcc} command. +via the @command{g77} or @command{gcc} command. The description of this option is provided so that users seeing it in the output of, say, @samp{g77 -v} understand why it is there. @@ -424,13 +419,13 @@ there. @cindex code, modifying Also, developers who run @code{f771} directly might want to specify it by hand to get the same defaults as they would running @code{f771} -via @code{g77} or @code{gcc}. +via @command{g77} or @command{gcc} However, such developers should, after linking a new @code{f771} executable, invoke it without this option once, e.g. via @kbd{./f771 -quiet < /dev/null}, to ensure that they have not introduced any internal inconsistencies (such as in the table of -intrinsics) before proceeding---@code{g77} will crash +intrinsics) before proceeding---@command{g77} will crash with a diagnostic if it detects an inconsistency. @cindex -fno-silent option @@ -444,13 +439,13 @@ with a diagnostic if it detects an inconsistency. @item -fno-silent Print (to @code{stderr}) the names of the program units as they are compiled, in a form similar to that used by popular -UNIX @code{f77} implementations and @code{f2c}. +UNIX @code{f77} implementations and @command{f2c} @end table @xref{Overall Options,,Options Controlling the Kind of Output, gcc,Using and Porting GNU CC}, for information -on more options that control the overall operation of the @code{gcc} command -(and, by extension, the @code{g77} command). +on more options that control the overall operation of the @command{gcc} command +(and, by extension, the @command{g77} command). @node Shorthand Options @section Shorthand Options @@ -462,7 +457,7 @@ on more options that control the overall operation of the @code{gcc} command The following options serve as ``shorthand'' for other options accepted by the compiler: -@table @code +@table @gcctabopt @cindex -fugly option @cindex options, -fugly @item -fugly @@ -510,11 +505,11 @@ Same as: Specify that the program is written in idiomatic FORTRAN 66. Same as @samp{-fonetrip -fugly-assumed}. -The @samp{-fno-f66} option is the inverse of @samp{-ff66}. +The @option{-fno-f66} option is the inverse of @option{-ff66}. As such, it is the same as @samp{-fno-onetrip -fno-ugly-assumed}. The meaning of this option is likely to be refined as future -versions of @code{g77} provide more compatibility with other +versions of @command{g77} provide more compatibility with other existing and obsolete Fortran implementations. @cindex -ff77 option @@ -526,25 +521,25 @@ existing and obsolete Fortran implementations. @cindex f77 compatibility @cindex compatibility, f77 Specify that the program is written in idiomatic UNIX FORTRAN 77 -and/or the dialect accepted by the @code{f2c} product. +and/or the dialect accepted by the @command{f2c} product. Same as @samp{-fbackslash -fno-typeless-boz}. The meaning of this option is likely to be refined as future -versions of @code{g77} provide more compatibility with other +versions of @command{g77} provide more compatibility with other existing and obsolete Fortran implementations. @cindex -fno-f77 option @cindex options, -fno-f77 @item -fno-f77 @cindex UNIX f77 -The @samp{-fno-f77} option is @emph{not} the inverse -of @samp{-ff77}. +The @option{-fno-f77} option is @emph{not} the inverse +of @option{-ff77}. It specifies that the program is not written in idiomatic UNIX -FORTRAN 77 or @code{f2c}, but in a more widely portable dialect. -@samp{-fno-f77} is the same as @samp{-fno-backslash}. +FORTRAN 77 or @command{f2c} but in a more widely portable dialect. +@option{-fno-f77} is the same as @option{-fno-backslash}. The meaning of this option is likely to be refined as future -versions of @code{g77} provide more compatibility with other +versions of @command{g77} provide more compatibility with other existing and obsolete Fortran implementations. @end table @@ -557,7 +552,7 @@ existing and obsolete Fortran implementations. The following options control the dialect of Fortran that the compiler accepts: -@table @code +@table @gcctabopt @cindex -ffree-form option @cindex options, -ffree-form @cindex -fno-fixed-form option @@ -581,7 +576,7 @@ This option controls whether certain Fortran 90 constructs are recognized. (Other Fortran 90 constructs might or might not be recognized depending on other options such as -@samp{-fvxt}, @samp{-ff90-intrinsics-enable}, and the +@option{-fvxt}, @option{-ff90-intrinsics-enable}, and the current level of support for Fortran 90.) @xref{Fortran 90}, for more information. @@ -596,8 +591,8 @@ meanings depending on whether the code is written in GNU Fortran (based on FORTRAN 77 and akin to Fortran 90) or VXT Fortran (more like VAX FORTRAN). -The default is @samp{-fno-vxt}. -@samp{-fvxt} specifies that the VXT Fortran interpretations +The default is @option{-fno-vxt}. +@option{-fvxt} specifies that the VXT Fortran interpretations for those constructs are to be chosen. @xref{VXT Fortran}, for more information. @@ -619,22 +614,22 @@ Allow @samp{$} as a valid character in a symbol name. Specify that @samp{\} is not to be specially interpreted in character and Hollerith constants a la C and many UNIX Fortran compilers. -For example, with @samp{-fbackslash} in effect, @samp{A\nB} specifies +For example, with @option{-fbackslash} in effect, @samp{A\nB} specifies three characters, with the second one being newline. -With @samp{-fno-backslash}, it specifies four characters, +With @option{-fno-backslash}, it specifies four characters, @samp{A}, @samp{\}, @samp{n}, and @samp{B}. -Note that @code{g77} implements a fairly general form of backslash +Note that @command{g77} implements a fairly general form of backslash processing that is incompatible with the narrower forms supported by some other compilers. -For example, @samp{'A\003B'} is a three-character string in @code{g77}, +For example, @samp{'A\003B'} is a three-character string in @command{g77} whereas other compilers that support backslash might not support the three-octal-digit form, and thus treat that string as longer than three characters. @xref{Backslash in Constants}, for -information on why @samp{-fbackslash} is the default -instead of @samp{-fno-backslash}. +information on why @option{-fbackslash} is the default +instead of @option{-fno-backslash}. @cindex -fno-ugly-args option @cindex options, -fno-ugly-args @@ -678,10 +673,10 @@ as specification of a single null argument. For example, @samp{CALL FOO(,)} is treated as @samp{CALL FOO(%VAL(0), %VAL(0))}. That is, @emph{two} null arguments are specified -by the procedure call when @samp{-fugly-comma} is in force. +by the procedure call when @option{-fugly-comma} is in force. And @samp{F = FUNC()} is treated as @samp{F = FUNC(%VAL(0))}. -The default behavior, @samp{-fno-ugly-comma}, is to ignore +The default behavior, @option{-fno-ugly-comma}, is to ignore a single trailing comma in an argument list. So, by default, @samp{CALL FOO(X,)} is treated exactly the same as @samp{CALL FOO(X)}. @@ -697,7 +692,7 @@ type other than @code{COMPLEX(KIND=1)}---usually this is used to permit @code{COMPLEX(KIND=2)} (@code{DOUBLE COMPLEX}) operands. -The @samp{-ff90} option controls the interpretation +The @option{-ff90} option controls the interpretation of this construct. @xref{Ugly Complex Part Extraction}, for more information. @@ -711,7 +706,7 @@ use of character constants to initialize numeric types and vice versa. For example, @samp{DATA I/'F'/, CHRVAR/65/, J/4HABCD/} is disallowed by -@samp{-fno-ugly-init}. +@option{-fno-ugly-init}. @xref{Ugly Conversion of Initializers}, for more information. @@ -754,7 +749,7 @@ For example, some code written to the FORTRAN 66 standard expects this behavior from its @code{DO} loops, although that standard did not specify this behavior. -The @samp{-fonetrip} option specifies that the source file(s) being +The @option{-fonetrip} option specifies that the source file(s) being compiled require one-trip loops. This option affects only those loops specified by the (iterative) @code{DO} @@ -803,7 +798,7 @@ compatibility. @cindex options, -fintrin-case-any @item -fintrin-case-any Specify expected case for intrinsic names. -@samp{-fintrin-case-lower} is the default. +@option{-fintrin-case-lower} is the default. @cindex -fmatch-case-initcap option @cindex options, -fmatch-case-initcap @@ -818,7 +813,7 @@ Specify expected case for intrinsic names. @cindex options, -fmatch-case-any @item -fmatch-case-any Specify expected case for keywords. -@samp{-fmatch-case-lower} is the default. +@option{-fmatch-case-lower} is the default. @cindex -fsource-case-upper option @cindex options, -fsource-case-upper @@ -831,7 +826,7 @@ Specify expected case for keywords. @item -fsource-case-preserve Specify whether source text other than character and Hollerith constants is to be translated to uppercase, to lowercase, or preserved as is. -@samp{-fsource-case-lower} is the default. +@option{-fsource-case-lower} is the default. @cindex -fsymbol-case-initcap option @cindex options, -fsymbol-case-initcap @@ -846,7 +841,7 @@ is to be translated to uppercase, to lowercase, or preserved as is. @cindex options, -fsymbol-case-any @item -fsymbol-case-any Specify valid cases for user-defined symbol names. -@samp{-fsymbol-case-any} is the default. +@option{-fsymbol-case-any} is the default. @cindex -fcase-strict-upper option @cindex options, -fcase-strict-upper @@ -909,7 +904,7 @@ variables named @samp{i} and @samp{I} to a procedure named @samp{Foo}.) @cindex @code{badu77} intrinsics @cindex intrinsics, @code{badu77} Specify status of UNIX intrinsics having inappropriate forms. -@samp{-fbadu77-intrinsics-enable} is the default. +@option{-fbadu77-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -ff2c-intrinsics-delete option @@ -924,10 +919,10 @@ Specify status of UNIX intrinsics having inappropriate forms. @cindex -ff2c-intrinsics-enable option @cindex options, -ff2c-intrinsics-enable @item -ff2c-intrinsics-enable -@cindex @code{f2c} intrinsics -@cindex intrinsics, @code{f2c} +@cindex @command{f2c} intrinsics +@cindex intrinsics, @command{f2c} Specify status of f2c-specific intrinsics. -@samp{-ff2c-intrinsics-enable} is the default. +@option{-ff2c-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -ff90-intrinsics-delete option @@ -945,7 +940,7 @@ Specify status of f2c-specific intrinsics. @cindex Fortran 90, intrinsics @cindex intrinsics, Fortran 90 Specify status of F90-specific intrinsics. -@samp{-ff90-intrinsics-enable} is the default. +@option{-ff90-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -fgnu-intrinsics-delete option @@ -964,7 +959,7 @@ Specify status of F90-specific intrinsics. @cindex @code{COMPLEX} intrinsics @cindex intrinsics, @code{COMPLEX} Specify status of Digital's COMPLEX-related intrinsics. -@samp{-fgnu-intrinsics-enable} is the default. +@option{-fgnu-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -fmil-intrinsics-delete option @@ -982,7 +977,7 @@ Specify status of Digital's COMPLEX-related intrinsics. @cindex MIL-STD 1753 @cindex intrinsics, MIL-STD 1753 Specify status of MIL-STD-1753-specific intrinsics. -@samp{-fmil-intrinsics-enable} is the default. +@option{-fmil-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -funix-intrinsics-delete option @@ -1000,7 +995,7 @@ Specify status of MIL-STD-1753-specific intrinsics. @cindex UNIX intrinsics @cindex intrinsics, UNIX Specify status of UNIX intrinsics. -@samp{-funix-intrinsics-enable} is the default. +@option{-funix-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -fvxt-intrinsics-delete option @@ -1018,7 +1013,7 @@ Specify status of UNIX intrinsics. @cindex VXT intrinsics @cindex intrinsics, VXT Specify status of VXT intrinsics. -@samp{-fvxt-intrinsics-enable} is the default. +@option{-fvxt-intrinsics-enable} is the default. @xref{Intrinsic Groups}. @cindex -ffixed-line-length-@var{n} option @@ -1041,8 +1036,8 @@ to ``extended-source'' options in some popular compilers). @var{n} may be @samp{none}, meaning that the entire line is meaningful and that continued character constants never have implicit spaces appended to them to fill out the line. -@samp{-ffixed-line-length-0} means the same thing as -@samp{-ffixed-line-length-none}. +@option{-ffixed-line-length-0} means the same thing as +@option{-ffixed-line-length-none}. @xref{Source Form}, for more information. @end table @@ -1058,17 +1053,17 @@ Warnings are diagnostic messages that report constructions which are not inherently erroneous but which are risky or suggest there might have been an error. -You can request many specific warnings with options beginning @samp{-W}, -for example @samp{-Wimplicit} to request warnings on implicit +You can request many specific warnings with options beginning @option{-W}, +for example @option{-Wimplicit} to request warnings on implicit declarations. Each of these specific warning options also has a -negative form beginning @samp{-Wno-} to turn off warnings; -for example, @samp{-Wno-implicit}. This manual lists only one of the +negative form beginning @option{-Wno-} to turn off warnings; +for example, @option{-Wno-implicit}. This manual lists only one of the two forms, whichever is not the default. These options control the amount and kinds of warnings produced by GNU Fortran: -@table @code +@table @gcctabopt @cindex syntax checking @cindex -fsyntax-only option @cindex options, -fsyntax-only @@ -1079,7 +1074,7 @@ Check the code for syntax errors, but don't do anything beyond that. @cindex options, -pedantic @item -pedantic Issue warnings for uses of extensions to ANSI FORTRAN 77. -@samp{-pedantic} also applies to C-language constructs where they +@option{-pedantic} also applies to C-language constructs where they occur in GNU Fortran source files, such as use of @samp{\e} in a character constant within a directive like @samp{#include}. @@ -1089,22 +1084,22 @@ However, without this option, certain GNU extensions and traditional Fortran features are supported as well. With this option, many of them are rejected. -Some users try to use @samp{-pedantic} to check programs for strict ANSI +Some users try to use @option{-pedantic} to check programs for strict ANSI conformance. They soon find that it does not do quite what they want---it finds some non-ANSI practices, but not all. -However, improvements to @code{g77} in this area are welcome. +However, improvements to @command{g77} in this area are welcome. @cindex -pedantic-errors option @cindex options, -pedantic-errors @item -pedantic-errors -Like @samp{-pedantic}, except that errors are produced rather than +Like @option{-pedantic}, except that errors are produced rather than warnings. @cindex -fpedantic option @cindex options, -fpedantic @item -fpedantic -Like @samp{-pedantic}, but applies only to Fortran constructs. +Like @option{-pedantic}, but applies only to Fortran constructs. @cindex -w option @cindex options, -w @@ -1140,7 +1135,7 @@ declared. Has an effect similar to using the @code{IMPLICIT NONE} statement in every program unit. (Some Fortran compilers provide this feature by an option -named @samp{-u} or @samp{/WARNINGS=DECLARATIONS}.) +named @option{-u} or @samp{/WARNINGS=DECLARATIONS}.) @cindex -Wunused option @cindex options, -Wunused @@ -1158,7 +1153,7 @@ Warn whenever an automatic variable is used without first being initialized. These warnings are possible only in optimizing compilation, because they require data-flow information that is computed only -when optimizing. If you don't specify @samp{-O}, you simply won't +when optimizing. If you don't specify @option{-O}, you simply won't get these warnings. These warnings occur only for variables that are candidates for @@ -1209,25 +1204,25 @@ This has no bug because @code{VALUE} is used only if it is set. @item -Wall @cindex all warnings @cindex warnings, all -The @samp{-Wunused} and @samp{-Wuninitialized} options combined. +The @option{-Wunused} and @option{-Wuninitialized} options combined. These are all the options which pertain to usage that we recommend avoiding and that we believe is easy to avoid. -(As more warnings are added to @code{g77}, some might -be added to the list enabled by @samp{-Wall}.) +(As more warnings are added to @command{g77} some might +be added to the list enabled by @option{-Wall}.) @end table -The remaining @samp{-W@dots{}} options are not implied by @samp{-Wall} +The remaining @option{-W@dots{}} options are not implied by @option{-Wall} because they warn about constructions that we consider reasonable to use, on occasion, in clean programs. -@table @code +@table @gcctabopt @c @item -W @c Print extra warning messages for these events: @c @c @itemize @bullet @c @item -@c If @samp{-Wall} or @samp{-Wunused} is also specified, warn about unused +@c If @option{-Wall} or @option{-Wunused} is also specified, warn about unused @c arguments. @c @c @end itemize @@ -1249,19 +1244,19 @@ as @samp{X*-Y}. Such a construct is nonstandard, and can produce unexpected results in more complicated situations such as @samp{X**-Y*Z}. -@code{g77}, along with many other compilers, interprets +@command{g77} along with many other compilers, interprets this example differently than many programmers, and a few other compilers. -Specifically, @code{g77} interprets @samp{X**-Y*Z} as +Specifically, @command{g77} interprets @samp{X**-Y*Z} as @samp{(X**(-Y))*Z}, while others might think it should be interpreted as @samp{X**(-(Y*Z))}. A revealing example is the constant expression @samp{2**-2*1.}, -which @code{g77} evaluates to .25, while others might evaluate +which @command{g77} evaluates to .25, while others might evaluate it to 0., the difference resulting from the way precedence affects type promotion. -(The @samp{-fpedantic} option also warns about expressions +(The @option{-fpedantic} option also warns about expressions having two arithmetic operators in a row.) @item @@ -1298,7 +1293,7 @@ code. of integral type---that is, using @code{REAL} variables as loop control variables. Although such loops can be written to work in the -``obvious'' way, the way @code{g77} is required by the +``obvious'' way, the way @command{g77} is required by the Fortran standard to interpret such code is likely to be quite different from the way many programmers expect. (This is true of all @code{DO} loops, but the differences @@ -1318,8 +1313,8 @@ Make all warnings into errors. @cindex extra warnings @cindex warnings, extra Turns on ``extra warnings'' and, if optimization is specified -via @samp{-O}, the @samp{-Wuninitialized} option. -(This might change in future versions of @code{g77}.) +via @option{-O}, the @option{-Wuninitialized} option. +(This might change in future versions of @command{g77} ``Extra warnings'' are issued for: @@ -1331,7 +1326,7 @@ via @samp{-O}, the @samp{-Wuninitialized} option. @cindex arguments, unused @cindex unused dummies @cindex dummies, unused -Unused parameters to a procedure (when @samp{-Wunused} also is +Unused parameters to a procedure (when @option{-Wunused} also is specified). @item @@ -1343,11 +1338,11 @@ for certain configurations). @xref{Warning Options,,Options to Request or Suppress Warnings, gcc,Using and Porting GNU CC}, for information on more options offered -by the GBE shared by @code{g77}, @code{gcc}, and other GNU compilers. +by the GBE shared by @command{g77} @command{gcc} and other GNU compilers. Some of these have no effect when compiling programs written in Fortran: -@table @code +@table @gcctabopt @cindex -Wcomment option @cindex options, -Wcomment @item -Wcomment @@ -1393,9 +1388,9 @@ GNU Fortran programs, but are not yet supported. @cindex debugging information options GNU Fortran has various special options that are used for debugging -either your program or @code{g77}. +either your program or @command{g77} -@table @code +@table @gcctabopt @cindex -g option @cindex options, -g @item -g @@ -1413,22 +1408,22 @@ gcc,Using and Porting GNU CC}, for more information on debugging options. @cindex options, optimization Most Fortran users will want to use no optimization when -developing and testing programs, and use @samp{-O} or @samp{-O2} when +developing and testing programs, and use @option{-O} or @option{-O2} when compiling programs for late-cycle testing and for production use. However, note that certain diagnostics---such as for uninitialized -variables---depend on the flow analysis done by @samp{-O}, i.e.@: you -must use @samp{-O} or @samp{-O2} to get such diagnostics. +variables---depend on the flow analysis done by @option{-O}, i.e.@: you +must use @option{-O} or @option{-O2} to get such diagnostics. The following flags have particular applicability when compiling Fortran programs: -@table @code +@table @gcctabopt @cindex -malign-double option @cindex options, -malign-double @item -malign-double (Intel x86 architecture only.) -Noticeably improves performance of @code{g77} programs making +Noticeably improves performance of @command{g77} programs making heavy use of @code{REAL(KIND=2)} (@code{DOUBLE PRECISION}) data on some systems. In particular, systems using Pentium, Pentium Pro, 586, and @@ -1442,14 +1437,14 @@ This option can, at least, make benchmark results more consistent across various system configurations, versions of the program, and data sets. -@emph{Note:} The warning in the @code{gcc} documentation about +@emph{Note:} The warning in the @command{gcc} documentation about this option does not apply, generally speaking, to Fortran -code compiled by @code{g77}. +code compiled by @command{g77} @xref{Aligned Data}, for more information on alignment issues. -@emph{Also also note:} The negative form of @samp{-malign-double} -is @samp{-mno-align-double}, not @samp{-benign-double}. +@emph{Also also note:} The negative form of @option{-malign-double} +is @option{-mno-align-double}, not @option{-benign-double}. @cindex -ffloat-store option @cindex options, -ffloat-store @@ -1462,7 +1457,7 @@ some machines, but might slow down a program that doesn't. This option is effective when the floating-point unit is set to work in IEEE 854 `extended precision'---as it typically is on x86 and m68k GNU -systems---rather than IEEE 754 double precision. @samp{-ffloat-store} +systems---rather than IEEE 754 double precision. @option{-ffloat-store} tries to remove the extra precision by spilling data from floating-point registers into memory and this typically involves a big performance hit. However, it doesn't affect intermediate results, so that it is @@ -1494,7 +1489,8 @@ Might improve optimization of loops. @item -fno-inline @cindex in-line code @cindex compilation, in-line -@c DL: Only relevant for -O3? +@c DL: Only relevant for -O3? TM: No, statement functions are +@c inlined even at -O1. Don't compile statement functions inline. Might reduce the size of a program unit---which might be at expense of some speed (though it should compile faster). @@ -1507,8 +1503,8 @@ Note that if you are not optimizing, no functions can be expanded inline. @cindex conformance, IEEE 754 Might allow some programs designed to not be too dependent on IEEE behavior for floating-point to run faster, or die trying. -Sets @samp{-funsafe-math-optimizations}, and -@samp{-fno-trapping-math}. +Sets @option{-funsafe-math-optimizations}, and +@option{-fno-trapping-math}. @cindex -funsafe-math-optimizations option @cindex options, -funsafe-math-optimizations @@ -1597,7 +1593,7 @@ currently recognized as such. This option unrolls only iterative @c DL: Check my understanding of -funroll-all-loops v. -funroll-loops is correct. Probably improves performance on code using @code{DO WHILE} loops by unrolling them in addition to iterative @code{DO} loops. In the absence -of @code{DO WHILE}, this option is equivalent to @samp{-funroll-loops} +of @code{DO WHILE}, this option is equivalent to @option{-funroll-loops} but possibly slower. @item -fno-move-all-movables @@ -1611,7 +1607,7 @@ but possibly slower. @cindex options, -fno-rerun-loop-opt @emph{Version info:} These options are not supported by -versions of @code{g77} based on @code{gcc} version 2.8. +versions of @command{g77} based on @command{gcc} version 2.8. Each of these might improve performance on some code. @@ -1628,7 +1624,7 @@ the performance of your production code. We're particularly interested in code that runs faster when these options are @emph{disabled}, and in non-Fortran code that benefits when they are -@emph{enabled} via the above @code{gcc} command-line options. +@emph{enabled} via the above @command{gcc} command-line options. @end table @xref{Optimize Options,,Options That Control Optimization, @@ -1650,12 +1646,12 @@ gcc,Using and Porting GNU CC}, for information on C preprocessor options. @cindex INCLUDE directive @cindex directive, INCLUDE -Some of these options also affect how @code{g77} processes the +Some of these options also affect how @command{g77} processes the @code{INCLUDE} directive. Since this directive is processed even when preprocessing is not requested, it is not described in this section. @xref{Directory Options,,Options for Directory Search}, for -information on how @code{g77} processes the @code{INCLUDE} directive. +information on how @command{g77} processes the @code{INCLUDE} directive. However, the @code{INCLUDE} directive does not apply preprocessing to the contents of the included file itself. @@ -1681,13 +1677,13 @@ when the preprocessor is used. @cindex INCLUDE directive @cindex directive, INCLUDE -Some of these options also affect how @code{g77} searches +Some of these options also affect how @command{g77} searches for files specified via the @code{INCLUDE} directive, although files included by that directive are not, themselves, preprocessed. These options are: -@table @code +@table @gcctabopt @cindex -I- option @cindex options, -I- @item -I- @@ -1702,19 +1698,19 @@ These affect interpretation of the @code{INCLUDE} directive (as well as of the @code{#include} directive of the @code{cpp} preprocessor). -Note that @samp{-I@var{dir}} must be specified @emph{without} any -spaces between @samp{-I} and the directory name---that is, -@samp{-Ifoo/bar} is valid, but @samp{-I foo/bar} -is rejected by the @code{g77} compiler (though the preprocessor supports +Note that @option{-I@var{dir}} must be specified @emph{without} any +spaces between @option{-I} and the directory name---that is, +@option{-Ifoo/bar} is valid, but @option{-I foo/bar} +is rejected by the @command{g77} compiler (though the preprocessor supports the latter form). @c this is due to toplev.c's inflexible option processing -Also note that the general behavior of @samp{-I} and -@code{INCLUDE} is pretty much the same as of @samp{-I} with +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 @code{cpp} preprocessor, with regard to looking for @file{header.gcc} files and other such things. @xref{Directory Options,,Options for Directory Search, -gcc,Using and Porting GNU CC}, for information on the @samp{-I} option. +gcc,Using and Porting GNU CC}, for information on the @option{-I} option. @end table @node Code Gen Options @@ -1727,12 +1723,12 @@ These machine-independent options control the interface conventions used in code generation. Most of them have both positive and negative forms; the negative form -of @samp{-ffoo} would be @samp{-fno-foo}. In the table below, only +of @option{-ffoo} would be @option{-fno-foo}. In the table below, only one of the forms is listed---the one which is not the default. You -can figure out the other form by either removing @samp{no-} or adding +can figure out the other form by either removing @option{no-} or adding it. -@table @code +@table @gcctabopt @cindex -fno-automatic option @cindex options, -fno-automatic @item -fno-automatic @@ -1742,7 +1738,7 @@ Treat each program unit as if the @code{SAVE} statement was specified for every local variable and array referenced in it. Does not affect common blocks. (Some Fortran compilers provide this option under -the name @samp{-static}.) +the name @option{-static}.) @cindex -finit-local-zero option @cindex options, -finit-local-zero @@ -1759,17 +1755,17 @@ to binary zeros. Since there is a run-time penalty for initialization of variables that are not given the @code{SAVE} attribute, it might be a -good idea to also use @samp{-fno-automatic} with @samp{-finit-local-zero}. +good idea to also use @option{-fno-automatic} with @option{-finit-local-zero}. @cindex -fno-f2c option @cindex options, -fno-f2c @item -fno-f2c -@cindex @code{f2c} compatibility -@cindex compatibility, @code{f2c} +@cindex @command{f2c} compatibility +@cindex compatibility, @command{f2c} Do not generate code designed to be compatible with code generated -by @code{f2c}; use the GNU calling conventions instead. +by @command{f2c} use the GNU calling conventions instead. -The @code{f2c} calling conventions require functions that return +The @command{f2c} calling conventions require functions that return type @code{REAL(KIND=1)} to actually return the C type @code{double}, and functions that return type @code{COMPLEX} to return the values via an extra argument in the calling sequence that points @@ -1783,23 +1779,23 @@ equivalent). This does not affect the generation of code that interfaces with the @code{libg2c} library. -However, because the @code{libg2c} library uses @code{f2c} -calling conventions, @code{g77} rejects attempts to pass +However, because the @code{libg2c} library uses @command{f2c} +calling conventions, @command{g77} rejects attempts to pass intrinsics implemented by routines in this library as actual -arguments when @samp{-fno-f2c} is used, to avoid bugs when +arguments when @option{-fno-f2c} is used, to avoid bugs when they are actually called by code expecting the GNU calling conventions to work. For example, @samp{INTRINSIC ABS;CALL FOO(ABS)} is -rejected when @samp{-fno-f2c} is in force. -(Future versions of the @code{g77} run-time library might +rejected when @option{-fno-f2c} is in force. +(Future versions of the @command{g77} run-time library might offer routines that provide GNU-callable versions of the -routines that implement the @code{f2c}-callable intrinsics +routines that implement the @command{f2c} intrinsics that may be passed as actual arguments, so that -valid programs need not be rejected when @samp{-fno-f2c} +valid programs need not be rejected when @option{-fno-f2c} is used.) -@strong{Caution:} If @samp{-fno-f2c} is used when compiling any +@strong{Caution:} If @option{-fno-f2c} is used when compiling any source file used in a program, it must be used when compiling @emph{all} Fortran source files used in that program. @@ -1810,14 +1806,14 @@ source file used in a program, it must be used when compiling @item -ff2c-library Specify that use of @code{libg2c} (or the original @code{libf2c}) is required. -This is the default for the current version of @code{g77}. +This is the default for the current version of @command{g77} Currently it is not -valid to specify @samp{-fno-f2c-library}. +valid to specify @option{-fno-f2c-library}. This option is provided so users can specify it in shell scripts that build programs and libraries that require the @code{libf2c} library, even when being compiled by future -versions of @code{g77} that might otherwise default to +versions of @command{g77} that might otherwise default to generating code for an incompatible library. @cindex -fno-underscoring option @@ -1830,24 +1826,24 @@ generating code for an incompatible library. Do not transform names of entities specified in the Fortran source file by appending underscores to them. -With @samp{-funderscoring} in effect, @code{g77} appends two underscores +With @option{-funderscoring} in effect, @command{g77} appends two underscores to names with underscores and one underscore to external names with -no underscores. (@code{g77} also appends two underscores to internal +no underscores. (@command{g77} also appends two underscores to internal names with underscores to avoid naming collisions with external names. -The @samp{-fno-second-underscore} option disables appending of the +The @option{-fno-second-underscore} option disables appending of the second underscore in all cases.) This is done to ensure compatibility with code produced by many -UNIX Fortran compilers, including @code{f2c}, which perform the +UNIX Fortran compilers, including @command{f2c} which perform the same transformations. -Use of @samp{-fno-underscoring} is not recommended unless you are +Use of @option{-fno-underscoring} is not recommended unless you are experimenting with issues such as integration of (GNU) Fortran into existing system environments (vis-a-vis existing libraries, tools, and so on). -For example, with @samp{-funderscoring}, and assuming other defaults like -@samp{-fcase-lower} and that @samp{j()} and @samp{max_count()} are +For example, with @option{-funderscoring}, and assuming other defaults like +@option{-fcase-lower} and that @samp{j()} and @samp{max_count()} are external functions while @samp{my_var} and @samp{lvar} are local variables, a statement like @@ -1862,34 +1858,34 @@ is implemented as something akin to: i = j_() + max_count__(&my_var__, &lvar); @end smallexample -With @samp{-fno-underscoring}, the same statement is implemented as: +With @option{-fno-underscoring}, the same statement is implemented as: @smallexample i = j() + max_count(&my_var, &lvar); @end smallexample -Use of @samp{-fno-underscoring} allows direct specification of -user-defined names while debugging and when interfacing @code{g77}-compiled +Use of @option{-fno-underscoring} allows direct specification of +user-defined names while debugging and when interfacing @command{g77} code with other languages. Note that just because the names match does @emph{not} mean that the -interface implemented by @code{g77} for an external name matches the +interface implemented by @command{g77} for an external name matches the interface implemented by some other language for that same name. -That is, getting code produced by @code{g77} to link to code produced +That is, getting code produced by @command{g77} to link to code produced by some other compiler using this or any other method can be only a small part of the overall solution---getting the code generated by both compilers to agree on issues other than naming can require significant effort, and, unlike naming disagreements, linkers normally cannot detect disagreements in these other areas. -Also, note that with @samp{-fno-underscoring}, the lack of appended +Also, note that with @option{-fno-underscoring}, the lack of appended underscores introduces the very real possibility that a user-defined external name will conflict with a name in a system library, which could make finding unresolved-reference bugs quite difficult in some cases---they might occur at program run time, and show up only as buggy behavior at run time. -In future versions of @code{g77}, we hope to improve naming and linking +In future versions of @command{g77} we hope to improve naming and linking issues so that debugging always involves using the names as they appear in the source, even if the names as seen by the linker are mangled to prevent accidental linking between procedures with incompatible @@ -1905,7 +1901,7 @@ interfaces. Do not append a second underscore to names of entities specified in the Fortran source file. -This option has no effect if @samp{-fno-underscoring} is +This option has no effect if @option{-fno-underscoring} is in effect. Otherwise, with this option, an external name such as @samp{MAX_COUNT} @@ -1922,7 +1918,7 @@ Ignore the @samp{#ident} directive. @item -fzeros Treat initial values of zero as if they were any other value. -As of version 0.5.18, @code{g77} normally treats @code{DATA} and +As of version 0.5.18, @command{g77} normally treats @code{DATA} and other statements that are used to specify initial values of zero for variables and arrays as if no values were actually specified, in the sense that no diagnostics regarding multiple initializations @@ -1931,11 +1927,11 @@ are produced. This is done to speed up compiling of programs that initialize large arrays to zeros. -Use @samp{-fzeros} to revert to the simpler, slower behavior +Use @option{-fzeros} to revert to the simpler, slower behavior that can catch multiple initializations by keeping track of all initializations, zero or otherwise. -@emph{Caution:} Future versions of @code{g77} might disregard this option +@emph{Caution:} Future versions of @command{g77} might disregard this option (and its negative form, the default) or interpret it somewhat differently. The interpretation changes will affect only non-standard @@ -1946,29 +1942,31 @@ programs; standard-conforming programs should not be affected. @item -femulate-complex Implement @code{COMPLEX} arithmetic via emulation, instead of using the facilities of -the @code{gcc} back end that provide direct support of +the @command{gcc} back end that provide direct support of @code{complex} arithmetic. -(@code{gcc} had some bugs in its back-end support +(@command{gcc} had some bugs in its back-end support for @code{complex} arithmetic, due primarily to the support not being completed as of version 2.8.1 and @code{egcs} 1.1.2.) -Use @samp{-femulate-complex} if you suspect code-generation bugs, +Use @option{-femulate-complex} if you suspect code-generation bugs, or experience compiler crashes, -that might result from @code{g77} using the @code{COMPLEX} support -in the @code{gcc} back end. +that might result from @command{g77} using the @code{COMPLEX} support +in the @command{gcc} back end. If using that option fixes the bugs or crashes you are seeing, -that indicates a likely @code{g77} bugs +that indicates a likely @command{g77} bugs (though, all compiler crashes are considered bugs), so, please report it. (Note that the known bugs, now believed fixed, produced compiler crashes rather than causing the generation of incorrect code.) Use of this option should not affect how Fortran code compiled -by @code{g77} works in terms of its interfaces to other code, -e.g. that compiled by @code{f2c}. +by @command{g77} works in terms of its interfaces to other code, +e.g. that compiled by @command{f2c} + +As of GCC version 3.0, this option is not necessary anymore. -@emph{Caution:} Future versions of @code{g77} might ignore both forms +@emph{Caution:} Future versions of @command{g77} might ignore both forms of this option. @cindex -falias-check option @@ -1985,7 +1983,7 @@ of this option. @item -fno-argument-noalias-global @emph{Version info:} These options are not supported by -versions of @code{g77} based on @code{gcc} version 2.8. +versions of @command{g77} based on @command{gcc} version 2.8. These options specify to what degree aliasing (overlap) @@ -1994,11 +1992,11 @@ arguments (passed as pointers) and @code{COMMON} (external, or public) storage. The default for Fortran code, as mandated by the FORTRAN 77 and -Fortran 90 standards, is @samp{-fargument-noalias-global}. +Fortran 90 standards, is @option{-fargument-noalias-global}. The default for code written in the C language family is -@samp{-fargument-alias}. +@option{-fargument-alias}. -Note that, on some systems, compiling with @samp{-fforce-addr} in +Note that, on some systems, compiling with @option{-fforce-addr} in effect can produce more optimal code when the default aliasing options are in effect (and when optimization is enabled). @@ -2020,7 +2018,7 @@ that might cause a compiler crash when attempting to inline a reference to a procedure within a program unit. (The diagnostics themselves are still produced, but -as warnings, unless @samp{-Wno-globals} is specified, +as warnings, unless @option{-Wno-globals} is specified, in which case no relevant diagnostics are produced.) Further, this option disables such inlining, to @@ -2030,17 +2028,17 @@ code that would otherwise be diagnosed. As such, this option might be quite useful when compiling existing, ``working'' code that happens to have a few bugs that do not generally show themselves, -but which @code{g77} diagnoses. +but which @command{g77} diagnoses. Use of this option therefore has the effect of -instructing @code{g77} to behave more like it did +instructing @command{g77} to behave more like it did up through version 0.5.19.1, when it paid little or no attention to disagreements between program units about a procedure's type and argument information, and when it performed no inlining of procedures (except statement functions). -Without this option, @code{g77} defaults to performing +Without this option, @command{g77} defaults to performing the potentially inlining procedures as it started doing in version 0.5.20, but as of version 0.5.21, it also diagnoses disagreements that might cause such inlining @@ -2060,7 +2058,7 @@ instead of its @code{ARRAY_REF} construct to handle all array references. @emph{Note:} This option is not supported. -It is intended for use only by @code{g77} developers, +It is intended for use only by @command{g77} developers, to evaluate code-generation issues. It might be removed at any time. @@ -2082,22 +2080,22 @@ against the (locally) declared minimum and maximum values. The current implementation uses the @code{libf2c} library routine @code{s_rnge} to print the diagnostic. -However, whereas @code{f2c} generates a single check per +However, whereas @command{f2c} generates a single check per reference for a multi-dimensional array, of the computed offset against the valid offset range (0 through the size of the array), -@code{g77} generates a single check per @emph{subscript} expression. -This catches some cases of potential bugs that @code{f2c} does not, +@command{g77} generates a single check per @emph{subscript} expression. +This catches some cases of potential bugs that @command{f2c} does not, such as references to below the beginning of an assumed-size array. -@code{g77} also generates checks for @code{CHARACTER} substring references, -something @code{f2c} currently does not do. +@command{g77} also generates checks for @code{CHARACTER} substring references, +something @command{f2c} currently does not do. -Use the new @samp{-ffortran-bounds-check} option +Use the new @option{-ffortran-bounds-check} option to specify bounds-checking for only the Fortran code you are compiling, not necessarily for code written in other languages. @emph{Note:} To provide more detailed information on the offending subscript, -@code{g77} provides the @code{libg2c} run-time library routine @code{s_rnge} +@command{g77} provides the @code{libg2c} run-time library routine @code{s_rnge} with somewhat differently-formatted information. Here's a sample diagnostic: @@ -2127,7 +2125,7 @@ the offended substring position is the starting (leftmost) position, and the offending substring expression is @samp{11}. (Though the verbage of @code{s_rnge} is not ideal -for the purpose of the @code{g77} compiler, +for the purpose of the @command{g77} compiler, the above information should provide adequate diagnostic abilities to it users.) @end table @@ -2135,11 +2133,11 @@ to it users.) @xref{Code Gen Options,,Options for Code Generation Conventions, gcc,Using and Porting GNU CC}, for information on more options offered by the GBE -shared by @code{g77}, @code{gcc}, and other GNU compilers. +shared by @command{g77} @command{gcc} and other GNU compilers. Some of these do @emph{not} work when compiling programs written in Fortran: -@table @code +@table @gcctabopt @cindex -fpcc-struct-return option @cindex options, -fpcc-struct-return @item -fpcc-struct-return @@ -2148,7 +2146,7 @@ Some of these do @emph{not} work when compiling programs written in Fortran: @item -freg-struct-return You should not use these except strictly the same way as you used them to build the version of @code{libg2c} with which -you will be linking all code compiled by @code{g77} with the +you will be linking all code compiled by @command{g77} with the same option. @cindex -fshort-double option @@ -2180,7 +2178,7 @@ at the very least, even if it is built with the same option. GNU Fortran currently does not make use of any environment variables to control its operation above and beyond those -that affect the operation of @code{gcc}. +that affect the operation of @command{gcc}. @xref{Environment Variables,,Environment Variables Affecting GNU CC, gcc,Using and Porting GNU CC}, for information on environment |