This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, Fortran] PR34342 - BOZ diagnostic, Fortran 2003 BOZ, BOZ extensions


Tobias Burnus wrote:
> I did now the following changes to gfortran.texi (see below).
>   
Now really with the changes. It contains

a) Jerry's two changes

b) Corrects one typo and adds FLOAT, DCMPLX, COMPLEX and DFLOAT to the
list of intrinsics, for which a BOZ is transferred as bit pattern. (This
happens automatically as for REAL() w/o kind= and for FLOAT() the same
routine in simplify.c is used; besides, it also makes sense.)

c) Add BOZ to the list of supported Fortran 2003 features.

Tobias

--- gfortran.texi.old   2007-12-08 17:02:19.000000000 +0100
+++ gfortran.texi       2007-12-08 17:09:15.000000000 +0100
@@ -862,6 +862,9 @@
 @cindex ISO C Bindings
 Interoperability with C (ISO C Bindings)

+@item
+BOZ as argument of INT, REAL, DBLE and CMPLX.
+
 @end itemize


@@ -1095,9 +1098,11 @@
 Up to Fortran 95, BOZ literals were only allowed to initialize
 integer variables in DATA statements. Since Fortran 2003 BOZ literals
 are also allowed as argument of @code{REAL}, @code{DBLE}, @code{INT}
-and @code{CMPL}; the result is the same as if the integer BOZ
+and @code{CMPLX}; the result is the same as if the integer BOZ
 literal had been converted by @code{TRANSFER} to, respectively,
 @code{real}, @code{double precision}, @code{integer} or @code{complex}.
+The GNU Fortran intrinsic procedure @code{FLOAT}, @code{DFLOAT},
+@code{COMPLEX} and @code{DCMPLX} are treated alike.

 As an extension, GNU Fortran allows hexadecimal BOZ literal constants to
 be specified using the @code{X} prefix, in addition to the standard
@@ -1105,14 +1110,14 @@
 suffix to the string, for example, @code{Z'ABC'} and @code{'ABC'Z} are
 equivalent.

-Furthermore, GNU Fortran allows to use BOZ literal constants outside
+Furthermore, GNU Fortran allows using BOZ literal constants outside
 DATA statements and the four intrinsic functions allowed by Fortran 2003.
 In DATA statements, in direct assignments, where the right-hand side
 only contains a BOZ literal constant, and for old-style initializers of
 the form @code{integer i /o'0173'/}, the constant is transferred
 as if @code{TRANSFER} had been used. In all other cases, the BOZ literal
-constant is converted to an @code{INTEGER} value with the kind type with
-the largest decimal representation, and this value is then converted
+constant is converted to an @code{INTEGER} value with
+the largest decimal representation.  This value is then converted
 numerically to the type and kind of the variable in question.
 (For instance @code{real :: r = b'0000001' + 1} initializes @code{r}
 with @code{2.0}.) As different compilers implement the extension


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