F90-related question
Janus Weil
janus@gcc.gnu.org
Tue Dec 10 14:15:00 GMT 2013
>> > I don't knw the answers your questions,
>> > but if I had to guess the sentence can probably be removed.
>>
>> Well, if you don't know it, then I don't know who should. Apparently
>> you have committed this sentence in r97221.
>
> Hmm, so, I did. It seems that I wrote that sentence
> 9 years ago. I have no recall as to why/what the
> sentence was meant to convey :-/
Ok. Note that http://gcc.gnu.org/onlinedocs/gfortran/KIND-Type-Parameters.html
claims that the default kind for INTEGER and REAL is 4 (apparentyl
target-independent; if there are exceptions from this, they should be
documented there). Therefore I propose to remove the sentence "Do
nothing if this is already the default" (since this is apparently
never the case), see attached patch.
The patch also
* replaces the footnote-like markers (1) and (2) by ** and ***,
respectively (the numbers are confusing and might be mistaken for
alternative default values, I think),
* does some linkification and
* adds references from -fdefault-real-8 to -freal-4-real-8 and from
-fdefault-integer-8 to -finteger-4-integer-8 (illustrating the
differences).
Ok for trunk?
Cheers,
Janus
-------------- next part --------------
Index: gcc/fortran/gfortran.texi
===================================================================
--- gcc/fortran/gfortran.texi (revision 205857)
+++ gcc/fortran/gfortran.texi (working copy)
@@ -1134,16 +1134,16 @@
@table @code
@item INTEGER
-1, 2, 4, 8*, 16*, default: 4 (1)
+1, 2, 4, 8*, 16*, default: 4**
@item LOGICAL
-1, 2, 4, 8*, 16*, default: 4 (1)
+1, 2, 4, 8*, 16*, default: 4**
@item REAL
-4, 8, 10*, 16*, default: 4 (2)
+4, 8, 10*, 16*, default: 4***
@item COMPLEX
-4, 8, 10*, 16*, default: 4 (2)
+4, 8, 10*, 16*, default: 4***
@item CHARACTER
1, 4, default: 1
@@ -1151,23 +1151,22 @@
@end table
@noindent
-* = not available on all systems @*
-(1) Unless -fdefault-integer-8 is used @*
-(2) Unless -fdefault-real-8 is used
+* not available on all systems @*
+** unless @option{-fdefault-integer-8} is used @*
+*** unless @option{-fdefault-real-8} is used (see @ref{Fortran Dialect Options})
@noindent
The @code{KIND} value matches the storage size in bytes, except for
@code{COMPLEX} where the storage size is twice as much (or both real and
imaginary part are a real value of the given size). It is recommended to use
-the @code{SELECTED_CHAR_KIND}, @code{SELECTED_INT_KIND} and
-@code{SELECTED_REAL_KIND} intrinsics or the @code{INT8}, @code{INT16},
+the @ref{SELECTED_CHAR_KIND}, @ref{SELECTED_INT_KIND} and
+@ref{SELECTED_REAL_KIND} intrinsics or the @code{INT8}, @code{INT16},
@code{INT32}, @code{INT64}, @code{REAL32}, @code{REAL64}, and @code{REAL128}
parameters of the @code{ISO_FORTRAN_ENV} module instead of the concrete values.
The available kind parameters can be found in the constant arrays
@code{CHARACTER_KINDS}, @code{INTEGER_KINDS}, @code{LOGICAL_KINDS} and
-@code{REAL_KINDS} in the @code{ISO_FORTRAN_ENV} module
-(see @ref{ISO_FORTRAN_ENV}). For C interoperability, the kind parameters of
-the @code{ISO_C_BINDING} module should be used (see @ref{ISO_C_BINDING}).
+@code{REAL_KINDS} in the @ref{ISO_FORTRAN_ENV} module. For C interoperability,
+the kind parameters of the @ref{ISO_C_BINDING} module should be used.
@node Internal representation of LOGICAL variables
Index: gcc/fortran/invoke.texi
===================================================================
--- gcc/fortran/invoke.texi (revision 205857)
+++ gcc/fortran/invoke.texi (working copy)
@@ -329,17 +329,18 @@
@item -fdefault-integer-8
@opindex @code{fdefault-integer-8}
-Set the default integer and logical types to an 8 byte wide type.
-Do nothing if this is already the default. This option also affects
-the kind of integer constants like @code{42}.
+Set the default @code{INTEGER} and @code{LOGICAL} types to an 8 byte wide type.
+This option also affects the kind of integer constants like @code{42}. Unlike
+@option{-finteger-4-integer-8}, it does not promote variables with explicit
+kind declaration.
@item -fdefault-real-8
@opindex @code{fdefault-real-8}
-Set the default real type to an 8 byte wide type.
-Do nothing if this is already the default. This option also affects
-the kind of non-double real constants like @code{1.0}, and does promote
+Set the default @code{REAL} type to an 8-byte-wide type. This option also
+affects the kind of non-double real constants like @code{1.0}, and does promote
the default width of @code{DOUBLE PRECISION} to 16 bytes if possible, unless
-@code{-fdefault-double-8} is given, too.
+@option{-fdefault-double-8} is given, too. Unlike @option{-freal-4-real-8},
+it does not promote variables with explicit kind declaration.
@item -fdefault-double-8
@opindex @code{fdefault-double-8}
More information about the Fortran
mailing list