aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/invoke.texi
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2021-10-29 15:08:47 -0700
committerSandra Loosemore <sandra@codesourcery.com>2021-11-04 09:53:02 -0700
commit227e0100360b83e7981ef9b2ce85435bbc16ee82 (patch)
tree9c1a41769fe35b9851f581686a08323b12fe2dfc /gcc/fortran/invoke.texi
parent2b1c757d835372d4454b3760b5fbf793bd372529 (diff)
downloadgcc-227e0100360b83e7981ef9b2ce85435bbc16ee82.zip
gcc-227e0100360b83e7981ef9b2ce85435bbc16ee82.tar.gz
gcc-227e0100360b83e7981ef9b2ce85435bbc16ee82.tar.bz2
Fortran manual: Revise introductory chapter.
Fix various bit-rot in the discussion of standards conformance, remove material that is only of historical interest, copy-editing. Also move discussion of preprocessing out of the introductory chapter. 2021-11-01 Sandra Loosemore <sandra@codesourcery.com> gcc/fortran/ * gfortran.texi (About GNU Fortran): Consolidate material formerly in other sections. Copy-editing. (Preprocessing and conditional compilation): Delete, moving most material to invoke.texi. (GNU Fortran and G77): Delete. (Project Status): Delete. (Standards): Update. (Fortran 95 status): Mention conditional compilation here. (Fortran 2003 status): Rewrite to mention the 1 missing feature instead of all the ones implemented. (Fortran 2008 status): Similarly for the 2 missing features. (Fortran 2018 status): Rewrite to reflect completion of TS29113 feature support. * invoke.texi (Preprocessing Options): Move material formerly in introductory chapter here.
Diffstat (limited to 'gcc/fortran/invoke.texi')
-rw-r--r--gcc/fortran/invoke.texi44
1 files changed, 40 insertions, 4 deletions
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 0fb7e1a..3533e86 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -570,10 +570,46 @@ Enhance test coverage by forcing most forall assignments to use temporary.
@cindex preprocessor
@cindex options, preprocessor
@cindex CPP
-
-Preprocessor related options. See section
-@ref{Preprocessing and conditional compilation} for more detailed
-information on preprocessing in @command{gfortran}.
+@cindex FPP
+@cindex Conditional compilation
+@cindex Preprocessing
+@cindex preprocessor, include file handling
+
+Many Fortran compilers including GNU Fortran allow passing the source code
+through a C preprocessor (CPP; sometimes also called the Fortran preprocessor,
+FPP) to allow for conditional compilation. In the case of GNU Fortran,
+this is the GNU C Preprocessor in the traditional mode. On systems with
+case-preserving file names, the preprocessor is automatically invoked if the
+filename extension is @file{.F}, @file{.FOR}, @file{.FTN}, @file{.fpp},
+@file{.FPP}, @file{.F90}, @file{.F95}, @file{.F03} or @file{.F08}. To manually
+invoke the preprocessor on any file, use @option{-cpp}, to disable
+preprocessing on files where the preprocessor is run automatically, use
+@option{-nocpp}.
+
+If a preprocessed file includes another file with the Fortran @code{INCLUDE}
+statement, the included file is not preprocessed. To preprocess included
+files, use the equivalent preprocessor statement @code{#include}.
+
+If GNU Fortran invokes the preprocessor, @code{__GFORTRAN__}
+is defined. The macros @code{__GNUC__}, @code{__GNUC_MINOR__} and
+@code{__GNUC_PATCHLEVEL__} can be used to determine the version of the
+compiler. See @ref{Top,,Overview,cpp,The C Preprocessor} for details.
+
+GNU Fortran supports a number of @code{INTEGER} and @code{REAL} kind types
+in additional to the kind types required by the Fortran standard.
+The availability of any given kind type is architecture dependent. The
+following pre-defined preprocessor macros can be used to conditionally
+include code for these additional kind types: @code{__GFC_INT_1__},
+@code{__GFC_INT_2__}, @code{__GFC_INT_8__}, @code{__GFC_INT_16__},
+@code{__GFC_REAL_10__}, and @code{__GFC_REAL_16__}.
+
+While CPP is the de-facto standard for preprocessing Fortran code,
+Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
+Conditional Compilation, which is not widely used and not directly
+supported by the GNU Fortran compiler. You can use the program coco
+to preprocess such files (@uref{http://www.daniellnagle.com/coco.html}).
+
+The following options control preprocessing of Fortran code:
@table @gcctabopt
@item -cpp