This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran, Patch] PR31547 - Document when gfortran runs the preprocessor


Tobias Burnus wrote:
> OK for the trunk?
>   
Why does one always find embarrassing typos just after one has hit  "send"?

s/preprossing/preprocessing/ig
s/surpressed/suppressed/

Tobias
2007-09-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/31547
	* gfortran.texi: Document when CPP is called.

	* intrinsic.texi (IOR): Fix typos.

Index: gfortran.texi
===================================================================
--- gfortran.texi	(revision 128271)
+++ gfortran.texi	(working copy)
@@ -220,16 +220,17 @@ compiler.
 The GNU Fortran compiler front end was
 designed initially as a free replacement for,
 or alternative to, the unix @command{f95} command;
 @command{gfortran} is the command you'll use to invoke the compiler.
 
 @menu
 * About GNU Fortran::    What you should know about the GNU Fortran compiler.
 * GNU Fortran and GCC::  You can compile Fortran, C, or other programs.
+* Preprocessing and conditional compilation:: The Fortran preprocessor
 * GNU Fortran and G77::  Why we chose to start from scratch.
 * Project Status::       Status of GNU Fortran, roadmap, proposed extensions.
 * Standards::	         Standards supported by GNU Fortran.
 @end menu
 
 
 @c ---------------------------------------------------------------------
 @c About GNU Fortran
@@ -377,16 +378,49 @@ the programming language's syntax and se
 which relate to the optimization passes and the back-end code generation
 are documented in the GCC manual; see 
 @ref{Top,,Introduction,gcc,Using the GNU Compiler Collection (GCC)}.
 The two manuals together provide a complete reference for the GNU
 Fortran compiler.
 
 
 @c ---------------------------------------------------------------------
+@c Preprocessing and conditional compilation
+@c ---------------------------------------------------------------------
+
+@node Preprocessing and conditional compilation
+@section Preprocessing and conditional compilation
+@cindex CPP
+@cindex FPP
+@cindex Conditional compilation
+@cindex Preprocessing
+
+Many Fortran compilers including GNU Fortran allow to pass the source code
+through a C preprocessor (CPP; sometimes also called Fortran preprocessor,
+fpp) to allow for conditional compilation. In case of GNU Fortran
+this is the GNU C Preprocessor in the traditional mode. On systems with
+case-sensitive file names, the preprocessor is automatically invoked if the
+file extension is @code{.F}, @code{.F90}, @code{.F95} or @code{.F03};
+otherwise use for fixed-format code the option @code{-x f77-cpp-input}
+and for free-format code @code{-x f95-cpp-input}. The calling of the
+preprocessor can be suppressed using @code{-x f77} and @code{-x f95}.
+
+If the GNU Fortran invoked called the preprocessor, @code{__GFORTRAN__}
+is defined and @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.
+
+While CPP is the de-facto standard, 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://users.erols.com/dnagle/coco.html}).
+
+
+@c ---------------------------------------------------------------------
 @c GNU Fortran and G77
 @c ---------------------------------------------------------------------
 
 @node GNU Fortran and G77
 @section GNU Fortran and G77
 @cindex Fortran 77
 @cindex @command{g77}
 
Index: intrinsic.texi
===================================================================
--- intrinsic.texi	(revision 128271)
+++ intrinsic.texi	(working copy)
@@ -5794,27 +5794,27 @@ The return value is a @code{INTEGER(8)} 
 @node IOR
 @section @code{IOR} --- Bitwise logical or
 @fnindex IOR
 @cindex bitwise logical or
 @cindex logical or, bitwise
 
 @table @asis
 @item @emph{Description}:
-@code{IEOR} returns the bitwise boolean OR of @var{I} and
+@code{IOR} returns the bitwise boolean inclusive-OR of @var{I} and
 @var{J}.
 
 @item @emph{Standard}:
 F95 and later
 
 @item @emph{Class}:
 Elemental function
 
 @item @emph{Syntax}:
-@code{RESULT = IEOR(I, J)}
+@code{RESULT = IOR(I, J)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
 @item @var{J} @tab The type shall be @code{INTEGER(*)}, of the same
 kind as @var{I}.  (As a GNU extension, different kinds are also 
 permitted.)
 @end multitable

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]